Search Results

Search found 57 results on 3 pages for 'uisegmentedcontrol'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Segmented Control to change views

    - by Goods
    I have created an up/down arrow segmented control button on the right side of the navigation bar in my detail view. In a table based application, how can I use these up/down arrows to move through cells in the parent table? The apple "NavBar" sample code has an example of this but the controls are not functional. The iBird program has this functionality as well and it is very nice. Download the "iBird 15" program for free. Any thoughts? Thanks!

    Read the article

  • iphone segmented control and uitableview

    - by Emma
    I have a UITableView with a segmented control at the top. When you tap on the different segments, I want the table to reload with a new different sized array. I have tried everything including [self.tableView reloadData]. When you click on a different tab now, it only changes the cells that are out of view and does not add any more. Any ideas??? Thanks.

    Read the article

  • selectedSegmentIndex not updating UISegmentControl

    - by munchine
    In my viewDidLoad, I'm retrieving user preferences and updating the settings tab. It is working for editSelection (see code) but the other NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; BOOL editSelection = [userDefaults boolForKey:@"editToggleSwitch"]; editingToggle.selectedSegmentIndex = editSelection; // this is working! bToggle.selectedSegmentIndex = [[userDefaults objectForKey:@"bSegment"] intValue]; In the view, the editingToggle segment is displaying correctly but bToggle is always at 0? NSLog shows that the data was saved and retrieved correctly. I've even set bToggle.selectedSegmentIndex = 1; but it still does not reflect correctly in the view? Any ideas?

    Read the article

  • Proper way to setup a UISegmentedControll on UINavigationController UINavigationBar all inside UITab

    - by Kaspa
    The title pretty much describes it all. The problem being the handling of the UISegmentedControll callbacks (button presses). If the content type of all of the nested views was the same (i.e. some UITableViewControllers) then I could just switch dataSource'es and reload the tables. However this is not the case, I have 3 very different views in there that allow further drilldown / interaction based on the NavigationControllers. So the way I have this set up ATM is that there is a "container" class that I put all of the UINavigationControllers in. They all share the same and one UISegmentedController and I redirect the callbacks to the container view controller. This does not feel too good at all. Additionally there is a problem when the user taps on the tab bar icon, the navigation controller pops to root which is ... the empty container view. Here's a picture of what I want to achieve:

    Read the article

  • How to store UISegmentedControle state in NSUserdefaults

    - by Chrizzz
    The problem is when de selectedSegmentIndex is unselected: "UISegmentedControlNoSegment" alias "-1". The other states (0, 1, 2 , etc.), I can store as Integers and retrieve with carTypeSegmentedControl.selectedSegmentIndex = [defaults integerForKey:@"typeOfCar"]; But -1 is no NSInteger. I also tried to remove the Integer out of the NSUserdefaults but a request would return an "0", which is not acceptable. So, is there another easy way? tnx for reading

    Read the article

  • How To Get Values From UISegmentcontroller.

    - by iappdevs
    Hi, I Created Segment Control through Interface Builder. Created a IBAction and Linked to Value Changed Option of segment Controller. (IBAction)GenderBttonAction:(id)sender { printf("\n Segemt Controll"); } When i click on segment controller this method is calling , but how would i get the seleced index value of segment controller. Please help me dears.

    Read the article

  • What is the default fontsize, fontname and shadow for titles in Navigation Bar?

    - by user292952
    I'm trying to have a button on the self.navigationItem.rightButton that toggles a segmented control that is placed in self.navgivationItem.titleView .. this will however remove the title that is first set by self.title when the navbar is created .. I dont know if my approach is bad but I figured I could rotate between a UILabel and the Segmented Control in the titleView. It works as I would like it to, however I cant figure out what size and font and shadowoffset and shadowcolor the default titles in a navigation bar is .. could you help me with a solution that either not force me to override the navigationItem.titleView or help me figure out the information needed to make a UILabel look exactly like the default titles. Thankful for any help.

    Read the article

  • How to remove segment at index at 0 of UISegmentcontrol in iphone?

    - by Warrior
    I am able to remove the segment at index 1,2,3 etc but not able to remove the segment at index 0 . [self readGroupFromDatabase]; NSLog(@"the current teble desc count value is %d",[tableDesc count]);---->0 if([tableDesc count]== 0){ [segemntedControl removeSegmentAtIndex:0 animated:NO]; } i am getting this error : *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (-1( or possibly larger)) beyond bounds (5)' Please help me out.Thanks.

    Read the article

  • Display TableViews corresponding to segmentedControl in a single tableview without pushing a new view

    - by user1727927
    I have a tableViewController where I have used the Interface Builder to insert a Segmented Controller having two segments. Since by default, first segment is always selected, I am not facing any problem in displaying the tableview corresponding to first segment. However, when I click on the second segment, I want to display another tableView. Here goes the problem. I am calling newTableViewController class on clicking the second segment. Hence, this view is getting pushed instead. Please suggest me a method to have these two tableViews in the main tableView upon clicking the segments. I have used switch case for switching between the segments. Here's the relevant part of the code: This method is in the FirstTableViewController since first segment is by default selected. -(IBAction) segmentedControlChanged { switch(segmentedControl.selectedSegmnentIndex) { case 0: //default first index selected. [tableView setHidden:NO]; break; case 1: NewViewController *controller=[[NewViewController alloc] initWithNibName:@"NewViewController" bundle:nil]; self.navigationController pushViewController:controller animated:YES]; [controller release]; break; default: break; } }

    Read the article

  • iphone - getting the button id in a segmented control

    - by Mike
    I am trying to create something that uses the idea of the UIPopOverController, I mean, have that speech bubble anchor pointing to the button who triggered the method. The problem is that I am using a UISegmentedControl... How do I get the id of the button that was tapped on a UISegmentedControl, so I can determine its position and generate the anchor? thanks for any help.

    Read the article

  • Should I really use a UITableView in this situation?

    - by mystify
    Imagine you have a view like this: At the top, there is an UISegmentedControl with two segments. It functions like a tab. Pressing one segment will activate this particular content below that UISegmentedControl. Below the UISegmentedControl are some switches. These modify the way how the content should be rendered. And finally, below those switches, there's a table. Imagine a table not in sense of UITableView, but just what it really is: A table. It shows little messages like twitter messages or chat messages for example, one below the other. Like you know it from skype and other chats. Basically they're just rows with some formatting. A label, some image views, some lines, a background. Pretty basic. The data comes from an array. No core data. The whole thing including the segmented control and setup switches must be scrollable. So what I did is: I put all this stuff in an UIScrollView. Now I have to make the decision if I would use a UITableView inside there for that table part, or if I would just print a lot of rows on to the scroll view (with -drawRect:). But some problems stick in my head: Can I put a UITableView inside a UIScrollView? I assume this makes a lot of problems. I don't want that the table part is separately scrollable. Again imagine that view: First there are some basic choice things (segmented control, switches). Then there comes the table. When you scroll, the whole thing scrolls. That's mainly because this first part with the settings can be pretty big, so you would want to scroll it away. The next thing is: Can I customize UITableView in such a way, that it consists of two parts? One for that settings part, and one for the actual data to display?

    Read the article

  • Weird background offset of UIToolbar when in formSheet.

    - by Mike A
    As you can see in the pic, the buttons from the toolbar on the right align perfectly with the segmented control on the left. They are displayed on the navigation bar. For some reason though, the background of the toolbar seems to be offset 1px to the bottom. What is especially weird, is this exact same view controller, in fullScreen or even pageSheet, displays everything properly. Segmented control is being allocated: UISegmentedControl* segmentControl = [[UISegmentedControl alloc] initWithFrame:CGRectMake(0,0,300,30)]; Toolbar is being allocated: UIToolbar* toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 100,44)]; I've spent hours trying to fix this, it's driving me crazy.

    Read the article

  • Adding subview, gets delayed?

    - by user289510
    Hi, i didn't really know how to title this question, but here's a thing that really kills me: In my app i have a UITableView, UISegmentedControl and UINavigationBar. Once UISegmentedControl gets one of its segments selected i want to show a UIActivityIndicatorView on the UINavigationBar and then parse an xml file and present the results in a table. Everything works almost as i want it to, except one thing, the activity indicator view gets added to the uinavigationbar after the parser finishes, even though the method showLoading that adds UIIndicatorView to UINavigationBar gets before parser is initialised. Can anyone explain it? is there something i might be missing? maybe the ui needs to get redrawn? thanks peter

    Read the article

  • Compile error on action for iPhone app: "error:expected ')' before ';' token"

    - by Jamis Charles
    I'm working through the tutorials in the "Beginning iPhone Development" book. I'm on chapter 4 and I'm getting the following compile error on the "if (segment == kShowSegmentIndex)" line: error:expected ')' before ';' token Here's my code: - (IBAction)toggleShowHide:(id)sender{ UISegmentedControl *segmentedControl = (UISegmentedControl *)sender; NSInteger segment = segmentedControl.selectedSegmentIndex; if (segment == kShowSegmentIndex) [switchView setHidden:NO]; else [switchView setHidden:YES]; } I've compared it with the code in the book several times and have retyped it. Sounds like this error is caused by improper brace placement. Any thoughts?

    Read the article

  • want to go to next view from rightbarbutton item.

    - by uttam
    I am using this code to get the three button on the right side of the navigationbar ,button are visible but next to this I want to go to the next view from this three button image, text ,vedio. NSArray *segmentTextContent = [NSArray arrayWithObjects:@"Image",@"Text",@"Video",nil]; UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:segmentTextContent]; segmentedControl.frame = CGRectMake(13, 20, 150, kCustomButtonHeight); segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar; segmentedControl.momentary = YES; defaultTintColor = [segmentedControl.tintColor retain]; // keep track of this for later UIBarButtonItem *segmentBarItem = [[UIBarButtonItem alloc] initWithCustomView:segmentedControl]; self.navigationItem.rightBarButtonItem = segmentBarItem; if(segmentedControl.selectedSegmentIndex=0) { [segmentedControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged]; } else if(segmentedControl.selectedSegmentIndex==1) { [segmentedControl addTarget:self action:@selector(segmentAction1:) forControlEvents:UIControlEventValueChanged]; } else if(segmentedControl.selectedSegmentIndex==2) { [segmentedControl addTarget:self action:@selector(segmentAction2:) forControlEvents:UIControlEventValueChanged]; } [segmentBarItem release]; //[modalBarButtonItem release]; } return self; }

    Read the article

  • Can't connect IBOutlet in Interface Builder

    - by Dave C
    Hello, I have the following code: @interface AddResident : UIViewController { IBOutlet UITextField *FirstName; IBOutlet UISegmentedControl *Gender; } I can see both of these outlets in interface builder but can only connect the UISegmented control... the other one will not connect to my UITextField on the form. Any help is much appreciated.

    Read the article

  • iphone sdk - segmentedcontrol.tintcolor not working in OS3

    - by ade
    In my app I have a uisegmentedcontrol in the navigation bar, as the right button item. the code: segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar; segmentedControl.tintColor = [UIColor colorWithRed:0.70 green:0.171 blue:0.1 alpha:1.0]; works in OS2 but not OS3...? ade. p.s. my base sdk is 3.0

    Read the article

  • MKMapView maptype not changing!

    - by TheLearner
    I cannot understand why my MKMapView does not want to change to satellite view. This method is called and case 1 is called I have stepped over it but it simply does not change to satellite type it always changes to standard. It only works when it goes back to Map type. Anyone have any ideas? - (IBAction)mapSatelliteSegmentControlTapped:(UISegmentedControl *)sender { switch (sender.selectedSegmentIndex) { case 1: //Satellite self.mapView.mapType = MKMapTypeSatellite; default: //Map self.mapView.mapType = MKMapTypeStandard; } }

    Read the article

  • iphone keyboard won't appear

    - by d_CFO
    I can click on the field, and it momentarily turns blue, but those events plus makeFirstResponder together do not cause the keyboard to show on a UITextField. Plain vanilla code follows; I include it so others can discern what is NOT there and therefore what, presumably, with solve the problem. I put in leading spaces to format this question more like code, but the parser seems to have stripped them, thus leaving left-justified code. Sorry! UITextFieldDelete, check: @interface RevenueViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> { UILabel *sgmntdControlLabel; UISegmentedControl *sgmntdControl; UITableView *theTableView; } @property(nonatomic,retain) UISegmentedControl *sgmntdControl; @property(nonatomic,retain) UILabel *sgmntdControlLabel; Delegate and source, check. -(void)loadView; // code CGRect frameTable = CGRectMake(10,0,300,260); theTableView = [[UITableView alloc] initWithFrame:frameTable style:UITableViewStyleGrouped]; [theTableView setDelegate:self]; [theTableView setDataSource:self]; // code [self.view addSubview:theTableView]; [super viewDidLoad]; } Insert UITextField to cell, check. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSInteger sectionNmbr = [indexPath section]; NSInteger rowNmbr = [indexPath row]; NSLog(@"cellForRowAtIndexPath=%d, %d",sectionNmbr,rowNmbr); static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell. switch (sectionNmbr) { case 0: if (rowNmbr == 0) { cell.tag = 1; cell.textLabel.text = @"Label for sctn 0, row 0"; UITextField *tf = [[UITextField alloc] init]; tf.keyboardType = UIKeyboardTypeNumberPad; tf.returnKeyType = UIReturnKeyDone; tf.delegate = self; [cell.contentView addSubview:tf]; } if (rowNmbr == 1) { cell.tag = 2; cell.textLabel.text = @"Label for sctn 0, row 1"; cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; } break; } } Successfully end up where we want to be (?), no check, (and no keyboard!): - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"didSelectRowAtIndexPath"); switch (indexPath.section) { case 0: NSLog(@" section=0, rowNmbr=%d",indexPath.row); switch (indexPath.row) { case 0: UITableViewCell *cellSelected = [tableView cellForRowAtIndexPath: indexPath]; UITextField *textField = [[cellSelected.contentView subviews] objectAtIndex: 0]; [ textField setEnabled: YES ]; [textField becomeFirstResponder]; // here is where keyboard will appear? [tableView deselectRowAtIndexPath: indexPath animated: NO]; break; case 1: // code break; default: break; } break; case 1: // code break; default: // handle otherwise un-handled exception break; } } Thank you for your insights!

    Read the article

  • UITableView insertRowsAtIndexPaths out of order

    - by bschlenk
    I currently have a UISegmentedControl set to add/remove table view cells when its value changes. Removing cells works perfectly, however when I insert cells they're in reverse order every other time. NSArray *addindexes = [NSArray arrayWithObjects:[NSIndexPath indexPathForRow:2 inSection:0], [NSIndexPath indexPathForRow:3 inSection:0], [NSIndexPath indexPathForRow:4 inSection:0], nil]; NSArray *removeindexes = [NSArray arrayWithObjects:[NSIndexPath indexPathForRow:2 inSection:0], [NSIndexPath indexPathForRow:3 inSection:0], [NSIndexPath indexPathForRow:4 inSection:0], nil]; [self.tableView beginUpdates]; switch (switchType.selectedSegmentIndex) { case 0: [self.tableView insertRowsAtIndexPaths:addindexes withRowAnimation:UITableViewRowAnimationTop]; break; case 1: [self.tableView deleteRowsAtIndexPaths:removeindexes withRowAnimation:UITableViewRowAnimationTop]; break; default: break; } [self.tableView endUpdates];} For example, every other time I add/remove cells they're in reverse order. (4, 3, 2 instead of 2, 3, 4) 1) Remove cells- add cells- correct order 2) Remove cells- add cells- incorrect order 3) Remove cells- add cells- correct order

    Read the article

< Previous Page | 1 2 3  | Next Page >