Search Results

Search found 250 results on 10 pages for 'uitabbarcontroller'.

Page 4/10 | < Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • How to get title of UITabBarItem in the More section?

    - by Sheehan Alam
    I have a UITabBarControllerDelegate method that determines the title of the UITabBarItem and does something accordingly. This works well for items in my UITabBar but when I click on the More button the rest of my UITabBarItems are in a UITableView. How can I determine the title in the More section? - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { if ([self.tabBarController.selectedViewController.title isEqualToString:@"All"]) { //do something } }

    Read the article

  • Tab bar controller in landscape mode

    - by gkedmi
    Hi to all All my app is in landscape mode .In some point I switch to a screen with Tab Bar Controller , but it's been placed like in portrait mode.I subclassed the UITabBarController and override the method "shouldAutorotateToInterfaceOrientation" to return YES always but because the app is already in landscape , this method is not being called. does anyway have an answer to this? thanks Giald

    Read the article

  • Application Design in Interface Builder Challenge

    - by Sheehan Alam
    I want to design an app that launches other sub-apps. Main View will contain 4 buttons. Clicking on each button respectively will launch the other sub-apps. Each sub-app will have a UITabBarController which has its own different views. At any point I want the user to be able to go back to the Main View from any of the sub-apps. I am not sure how to design this in IB.

    Read the article

  • Multi-level navigation controller on left-hand side of UISplitView with a small twist.

    - by user141146
    Hi. I'm trying make something similar to (but not exactly like) the email app found on the iPad. Specifically, I'd like to create a tab-based app, but each tab would present the user with a different UISplitView. Each UISplitView contains a Master and a Detail view (obviously). In each UISplitView I would like the Master to be a multi-level navigational controller where new UIViewControllers are pushed onto (or popped off of) the stack. This type of navigation within the UISplitView is where the application is similar to the native email app. To the best of my knowledge, the only place that has described a decent "splitviewcontroller inside of a uitabbarcontroller" is here: http://stackoverflow.com/questions/2475139/uisplitviewcontroller-in-a-tabbar-uitabbarcontroller and I've tried to follow the accepted answer. The accepted solution seems to work for me (i.e., I get a tab-bar controller that allows me to switch between different UISplitViews). The problem is that I don't know how to make the left-hand side of the UISplitView to be a multi-level navigation controller. Here is the code I used within my app delegate to create the initial "split view 'inside' of a tab bar controller" (it's pretty much as suggested in the aforementioned link). - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSMutableArray *tabArray = [NSMutableArray array]; NSMutableArray *array = [NSMutableArray array]; UISplitViewController *splitViewController = [[UISplitViewController alloc] init]; MainViewController *viewCont = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil]; [array addObject:viewCont]; [viewCont release]; viewCont = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil]; [array addObject:viewCont]; [viewCont release]; [splitViewController setViewControllers:array]; [tabArray addObject:splitViewController]; [splitViewController release]; array = [NSMutableArray array]; splitViewController = [[UISplitViewController alloc] init]; viewCont = [[Master2 alloc] initWithNibName:@"Master2" bundle:nil]; [array addObject:viewCont]; [viewCont release]; viewCont = [[Slave2 alloc] initWithNibName:@"Slave2" bundle:nil]; [array addObject:viewCont]; [viewCont release]; [splitViewController setViewControllers:array]; [tabArray addObject:splitViewController]; [splitViewController release]; // Add the tab bar controller's current view as a subview of the window [tabBarController setViewControllers:tabArray]; [window addSubview:tabBarController.view]; [window makeKeyAndVisible]; return YES; } the class MainViewController is a UIViewController that contains the following method: - (IBAction)push_me:(id)sender { M2 *m2 = [[[M2 alloc] initWithNibName:@"M2" bundle:nil] autorelease]; [self.navigationController pushViewController:m2 animated:YES]; } this method is attached (via interface builder) to a UIButton found within MainViewController.xib Obviously, the method above (push_me) is supposed to create a second UIViewController (called m2) and push m2 into view on the left-side of the split-view when the UIButton is pressed. And yet it does nothing when the button is pressed (even though I can tell that the method is called). Thoughts on where I'm going wrong? TIA!

    Read the article

  • How to use NSMutableDictionary to store and retrieve data

    - by TechFusion
    I have created Window Based application and tab bar controller as root controller. My objective is to store Text Field data values in one tab bar VC and will be accessible and editable by other VC and also retrievable when application start. I am looking to use NSMutableDictionary class in AppDelegate so that I can access stored Data Values with keys. //TestAppDelegate.h extern NSString *kNamekey ; extern NSString *kUserIDkey ; extern NSString *kPasswordkey ; @interface TestAppDelegate :NSObject{ UIWindow *window; IBOutlet UITabBarController *rootController; NSMutableDictionary *outlineData ; } @property(nonatomic,retain)IBOutlet UIWindow *window; @property(nonatomic,retain)IBOutlet UITabBarController *rootController; @property(nonatomic,retain) NSMutableDictionary *outlineData ; @end //TestAppDelegate.m import "TestAppDelegate.h" NSString *kNamekey =@"Namekey"; NSString *kUserIDkey =@"UserIDkey"; NSString *kPasswordkey =@"Passwordkey"; @implemetation TestAppDelegate @synthesize outlineData ; -(void)applicationDidFinishLaunching:(UIApplication)application { NSMutableDictionary *tempMutableCopy = [[[NSUserDefaults standardUserDefaults] objectForKey:kRestoreLocationKey] mutableCopy]; self.outlineData = tempMutableCopy; [tempMutableCopy release]; if(outlineData == nil){ NSString *NameDefault = NULL; NSString *UserIDdefault= NULL; NSString *Passworddefault= NULL; NSMutableDictionary *appDefaults = [NSMutableDictionary dictionaryWithObjectsAndKeys: NameDefault, kNamekey , UserIDdefault, kUserIDkey , Passworddefault, kPasswordkey , nil]; self.outlineData = appDefaults; [appDefaults release]; } [window addSubview:rootController.view]; [window makeKeyAndVisible]; NSMutableDictionary *savedLocationDict = [NSMutableDictionary dictionaryWithObject:outlineData forKey:kRestoreLocationKey]; [[NSUserDefaults standardUserDefaults] registerDefaults:savedLocationDict]; [[NSUserDefaults standardUserDefaults] synchronize]; } -(void)applicationWillTerminate:(UIApplication *)application { [[NSUserDefaults standardUserDefaults] setObject:outlineData forKey:kRestoreLocationKey]; } @end Here ViewController is ViewController of Navigation Controller which is attached with one tab bar.. I have attached xib file with ViewController //ViewController.h @interface IBOutlet UITextField *Name; IBOutlet UITextField *UserId; IBOutlet UITextField *Password; } @property(retain,nonatomic) IBOutlet UITextField *Name @property(retain,nonatomic) IBOutlet UITextField *UserId; @property(retain,nonatomic) IBOutlet UITextField *Password; -(IBAction)Save:(id)sender; @end Here in ViewController.m, I am storing object values with keys. /ViewController.m -(IBAction)Save:(id)sender{ TestAppDelegate appDelegate = (TestAppDelegate)[[UIApplication sharedApplication] delegate]; [appDelegate.outlineData setObject:Name.text forKey:kNamekey ]; [appDelegate.outlineData setObject:UserId.text forKey:kUserIDkey ]; [appDelegate.outlineData setObject:Password.text forKey:kPasswordkey]; [[NSUserDefaults standardUserDefaults] synchronize]; } I am accessing stored object using following method. -(void)loadData { TabBarAppDelegate *appDelegate = (TabBarAppDelegate *)[[UIApplication sharedApplication] delegate]; Name = [appDelegate.outlineData objectForKey:kNamekey ]; UserId = [appDelegate.outlineData objectForKey:kUserIDkey ]; Password = [appDelegate.outlineData objectForKey:kPasswordkey]; [Name release]; [UserId release]; [Password release]; } I am getting EXEC_BAD_ACCESS in application. Where I am making mistake ? Thanks,

    Read the article

  • How do I rotate only some views when working with a uinavigationcontroller as a tab of a uitabbarcon

    - by maxpower
    Here is a flow that I can not figure out how to work. ( when I state (working) it means that in that current state the rules for orientation for that view are working correctly) First View: TableView on the stack of a UINavigationController that is a tab of UITabBarController. TableView is only allowed to be portrait. (working) When you rotate the TableView to landscape a modal comes up with a custom UIView that is like a coverflow (which i'll explain the problem there in a moment). A Selection made on tableview pushes a UIScrollview on to the stack. UIScrollView is allowed all orientations. (working) When UIScrollView is in landscape mode and the user hits back they are taken to the custom UIView that is like the coverflow and only allows landscape. The problem is here. Because the UIScrollView allows full rotation it permitted the TableView to rotate as well to landscape. I have a method attached to a notification "UIDeviceOrientationDidChangeNotification" that checks to see if the custom view is the current controller and if it is and if the user has rotated back to portrait I need to pop the custom view and show the table view. The table view has to rotate back to portrait, which really is okay as long as the user doesn't see it. When I create custom animations it works pretty good except for some odd invisible black box that seems to rotate with the device right before I fade out the customview to the tableview. Further inorder to ensure that my tableview will rotate to portrait I have to allow the customview to support all orientations because the system looks to the current view (in my code) as to whether or not that app is allowed to rotate to a certain orientation. Because of this I many proposed solutions will show the customview rotating to portrait as the table view comes back to focus. My other problem is very similar. If you are viewing the tableview and rotate the modalview of the customview is presented. When you make a selection on this view it pushes the UIScrollview onto the stack, but because the Tableview only supports portrait the UIScrollview comes in in portrait while the device is in landscape mode. How can I overcome these awful blocks? This is my current attempt: When it comes to working with UITabBarController the system really only cares what the tabbarcontroller has to say about rotation. Currently whenever a view loads it reports it supported orientations. TabBarController.m - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { switch (self.supportedOrientation) { case SupportPortraitOrientation: [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; return (interfaceOrientation == UIInterfaceOrientationPortrait); break; case SupportPortraitUpsideDownOrientation: [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; return (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown); break; case SupportPortraitAllOrientation: [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown); break; case SupportLandscapeLeftOrientation: [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft); break; case SupportLandscapeRightOrienation: [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); break; case SupportLandscapeAllOrientation: [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); break; case SupportAllOrientation: if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) { [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; }else { //[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; } return YES; break; default: return (interfaceOrientation == UIInterfaceOrientationPortrait); break; } } This block of code is part of my UINavigationController and is in a method that responds to the UIDeviceOrientationDidChangeNotification Notification. It is responsible for poping the customview and showing the tableview. There are two different versions in place that originally were for two different versions of the SDK but both are pretty close to solutions. The reason the first is not supported on 3.0 is for some reason you can't have a view showing and then showen as a modal view. Not sure if that is a bug or a feature. The second solution works pretty good except that I see an outer box rotating around the iphone. if ([[self topViewController] isKindOfClass:FlowViewController.class]) { NSString *iphoneVersion = [[UIDevice currentDevice] systemVersion]; double version = [iphoneVersion doubleValue]; if(version > 3.0){ //1st solution //if the delivered app is not built with the 3.1 SDK I don't think this will happen anyway //we need to test this [self presentModalViewController:self.flowViewController animated:NO]; //[self toInterfaceOrientation:UIDeviceOrientationPortrait animated:NO]; [self popViewControllerAnimated:NO]; [self setNavigationBarHidden:NO animated:NO]; [self dismissModalViewControllerAnimated:YES]; }else{ //2nd solution DLog(@"3.0!!"); //[self toInterfaceOrientation:UIDeviceOrientationPortrait animated:NO]; CATransition *transition = [CATransition animation]; transition.duration = 0.50; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionPush; transition.subtype = kCATransitionFade; CATransition *tabBarControllerLayer = [CATransition animation]; tabBarControllerLayer.duration = 0.50; tabBarControllerLayer.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; tabBarControllerLayer.type = kCATransitionPush; tabBarControllerLayer.subtype = kCATransitionFade; [self.tabBarController.view.layer addAnimation:transition forKey:kCATransition]; [self.view.layer addAnimation:transition forKey:kCATransition]; [self popViewControllerAnimated:NO]; [self setNavigationBarHidden:NO animated:NO]; } [self performSelector:@selector(resetFlow) withObject:nil afterDelay:0.75]; } I'm near convinced there is no solution except for manual rotation which messes up the keyboard rotation. Any advice would be appreciated! Thanks.

    Read the article

  • How to add a Tab Bar to an existing view controller, without XIB

    - by Andre
    Hi, I'm trying to avoid using Interface Builder as much as possible. At the moment I have the view controller created via code and change views via code as well. I now need one of the steps to send the app into a new view with a tab bar, that will allow me to change views as well. Ideally, what I'd do is tell the current view controller to add a Tab Bar to the bottom, but I'm not sure if that's doable, so I might have to swap the UIViewController with a UITabBarController? Any help will be appreciated. Cheers, Andre

    Read the article

  • viewControllers is empty array

    - by Antonio
    Hi: I'm having a problem using the UITabBarController and can't seem to get anywhere... maybe someone has run into something similar. I have the typical Tab Bar + Navigation app and everything is working great, except when I access options in the More tab. On any other tab, if I log: NSLog(@"%@ \n %@",self.selectedViewController,[self.selectedViewController viewControllers]); I get, for example: 2010-05-29 00:05:13.512 MD[9950:207] <UINavigationController: 0x4c35ad0> ( <MDViewController: 0x4c35910>, <Detalle: 0x9050e80> ) If I access an element in the More tab, I get: 2010-05-29 00:05:13.512 MD[9950:207] <UINavigationController: 0x4c35ad0> ( ) An empty viewControllers array? Am I missing something? Thanks! Antonio

    Read the article

  • View controllers inside tab bar controller not auto-resizing on rotation

    - by Padawan
    (Correction: the view controllers are not auto-resizing instead of not auto-rotating.) In an iPad app, I have five regular view controllers (not navigation controllers or anything like that) inside a tab bar controller. The tab bar controller is just a plain UITabBarController declared in the app delegate. All the view controllers return YES in the shouldAutorotateToInterfaceOrientation method. On both the simulator and device, on rotation, the tab bar and the current view controller rotate but the currently selected view controller (call it A) does not resize properly. It keeps its portrait width and height (but it is rotated). If I switch to another view controller B and then back to A (without rotating the device again), A appears correctly resized. This happens with any of the five view controllers Why doesn't the currently selected view controller resize immediately on rotation and how do I fix it? Thanks.

    Read the article

  • "Filtering" Cells in a UITableView. Multiple Views? Subviews?

    - by Bryan Veloso
    (First question related to iPhone development, so apologies for sounding off-track.) I'm creating a view that has a few things; a UITabBarController controlling 3 UITableViews. Two of these TableViews are filtered versions of the 3rd. All of them will be making a JSON call (still working on that) to retrieve a list of objects. So, because these views are related in some way, would there be a more "sane" way to display this data? With say, subviews? Or would I have to just create 1 view for each that returns the desired data and be done with it? If it helps at all, I have full control over the API I'm talking with, so changes to that that help with this don't really matter to me too much. Thanks in advance!

    Read the article

  • View controllers inside tab bar controller not auto-rotating

    - by Padawan
    In an iPad app, I have five regular view controllers (not navigation controllers or anything like that) inside a tab bar controller. The tab bar controller is just a plain UITabBarController declared in the app delegate. All the view controllers return YES in the shouldAutorotateToInterfaceOrientation method. On both the simulator and device, on rotation, the tab bar rotates properly but the currently selected view controller (call it A) does not. If I switch to another view controller B and then back to A (without rotating the device again), A appears correctly rotated. This happens with any of the five view controllers Why doesn't the currently selected view controller rotate and how do I fix it? Thanks.

    Read the article

  • Select no tabs in a UITabBar

    - by Tom
    Hi, I'm trying to select no tabs at all in my application. At first the first tab is selected, but I'd like to deselect it so no tabs at all would be selected. Don't ask me why, it's just that way the client wants it! hehe Thanks for your help! PS: I already tried: // rootController = UITabBarController rootController.tabBar.selectedItem = 0; rootController.tabBar.selectedItem = nil; [rootController setSelectedIndex:[rootController.items objectAtIndex:0]]; [rootController setSelectedIndex:nil]; [rootController setSelectedIndex:0]; // That one works : (but I can't select 0 or -1 for instance) [rootController setSelectedIndex:2]; Any ideas? Thanks again!

    Read the article

  • is i need to create UINavigationController for each Tabbar?

    - by RAGOpoR
    i have a problem is i got UItabbarController it contain 3 Tabbars each tabbar need to create own UINavigationController for them? in IB it can only link UINavigationController to 1 navigationcontroller of tabbar only. it can't multiple link. how can i resolve for it. i want to hide and unhide my toolbar. i think it it a bad idea if i must create 3 uinavigationcontroller instance variable for each tabbar. how can i reslove this issue?

    Read the article

  • UISegmentedControl is hidden under the titleBar

    - by shay te
    i guess i am missing something with the UISegmentedControl and auto layout. i have a TabbedApplication (UITabBarController), and i created a new UIViewController to act as tab. to the new view i added UISegmentedControl, and place it to top using auto layout. i guess i don't understand completely something , cause the UISegmentedControl is hiding under the titleBar . can u help me understand what i am missing ? thank you . import Foundation import UIKit; class ViewLikes:UIViewController { override func viewDidLoad() { super.viewDidLoad() title = "some title"; var segmentControl:UISegmentedControl = UISegmentedControl(items:["blash", "blah blah"]); segmentControl.selectedSegmentIndex = 1; segmentControl.setTranslatesAutoresizingMaskIntoConstraints(false) self.view.addSubview(segmentControl) //Set layout var viewsDict = Dictionary <String, UIView>() viewsDict["segment"] = segmentControl; //controls self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-[segment]-|", options: NSLayoutFormatOptions.AlignAllCenterX, metrics: nil, views: viewsDict)) self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|-[segment]", options: NSLayoutFormatOptions(0), metrics: nil, views: viewsDict)) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }

    Read the article

  • How do I reset the state of a view inside a tabbar?

    - by ABeanSits
    Hello CocoaTouch-Experts! This is a fairly straightforward question though my Googling session gave me nothing. How do I reset the state of a view hierarchy located in a tabbar programmatically? The behavior I want to replicate is when the user tapps on a tab twice. This causes the view located under that tab to return to it's initial state. The tab is "owned" by a UINavigationController and when the user reaches a certain point in the view hierarchy there is a button which I want to connect this behavior to. All my attempts have failed except calling on a method in AppDelegate which kills the view and adds it back to the UITabBarController again. But this does not feel like the right way to go. Thanks in advance. Best regards //Abeansits

    Read the article

  • Tab bar controller inside a navigation controller, or sharing a navigation root view

    - by Daniel Dickison
    I'm trying to implement a UI structured like in the Tweetie app, which behaves as so: the top-level view controller seems to be a navigation controller, whose root view is an "Accounts" table view. If you click on any account, it goes to the second level, which has a tab bar across the bottom. Each tab item shows a different list and lets you drill down further (the subsequent levels don't show the tab bar). So, this seems like the implementation hierarchy is: UINavigationController Accounts: UITableViewController UITabBarController Tweets: UITableViewController Detail view of a tweet/user/etc Replies: UITableViewController ... This seems to work[^1], but appears to be unsupported according to the SDK documentation for -pushViewController:animated: (emphasis added): viewController: The view controller that is pushed onto the stack. It cannot be an instance of tab bar controller. I would like to avoid private APIs and the like, but I'm not sure why this usage is explicitly prohibited even when it seems to work fine. Anyone know the reason? I've thought about putting the tab bar controller as the main controller, with each of the tabs containing separate navigation controllers. The problem with this is that each nav controller needs to share a single root view controller (namely the "Accounts" table in Tweetie) -- this doesn't seem to work: pushing the table controller to a second nav controller seems to remove it from the first. Not to mention all the book-keeping when selecting a different account would probably be a pain. How should I implement this the Right Way? [^1]: The tab bar controller needs to be subclassed so that the tab bar controller's navigation item at that level stays in sync with the selected tab's navigation item, and the individual tab's table controller's need to push their respective detail views to self.tabBarController.navigationController instead of self.navigationController.

    Read the article

  • How to know when StatusBar size changed (iPhone)

    - by JOM
    I have UITabBarController with 2 tabs. One resizes just fine, when StatusBar size changes (emulator "Toggle In-Call Status Bar" menu item). The other one doesn't. The problematic tab item contains a static view, which dynamically loads one or another view depending on certain things. While getting this setup working I discovered that main tab view did NOT automagically send e.g. viewWillAppear and viewWillDisappear messages to my dynamic subviews. Apple docs explained this was because dynamically added views were not recognized by the system. @interface MyTabViewController : UIViewController { UIView *mainView; FirstViewController *aController; SecondViewController *bController; } ... if (index == 0) { self.aController = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil]; [self.mainView addSubview:aController.view]; [self.aController viewWillAppear:YES]; } How can I get StatusBar size changed event into my dynamic subviews? The "didChangeStatusBarFrame" doesn't work, as documented elsewhere.

    Read the article

  • UINavigationController navigation stack problems in Landscape Mode

    - by David F
    I have a iPhone application that I am currently converting to a Universal Binary to work with the iPad. I have successfully implemented everything I need in terms of layout so that full landscape functionality is now supported in my app (previously I primarily used portrait mode to display content). But, I have one strange problem, and it ONLY occurs in landscape mode: when I push a view controller onto the stack, it takes two taps on the back button to return to the previous view controller!!! The first tap shows a blank view, but with the same name on the left-side back navigation button, the second tap takes the controller back to previous view like it should. I don't have an iPad to test, so I am relying on the simulator. The problem does not show up on the iPhone and doesn't show up if you rotate back to portrait mode. My app consists of a tabbarcontroller with navigation controllers loaded for its vc's: //application delegate - (void)applicationDidFinishLaunching:(UIApplication *)application //.... WebHelpViewController *vc8 = [[WebHelpViewController alloc] init]; UINavigationController *nv8 = [[UINavigationController alloc] initWithRootViewController:vc8]; [self.tabBarController setViewControllers:[NSArray arrayWithObjects:nv1,nv2,nv3,nv4,nv5,nv6,nv7,nv8,nil]]; To implement landscape capability, the UITabBarController is overridden to autorotate when required: //CustomTabBarController.m - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return [[(UINavigationController *)self.selectedViewController topViewController] shouldAutorotateToInterfaceOrientation:interfaceOrientation]; } ... works fine. I navigate into new views using this method SomeViewController *vc = [[SomeViewController alloc] init]; [self.navigationController pushViewController:vc animated:YES]; [vc release]; Has anyone encountered this problem, and do they know if it's only a simulation error?

    Read the article

  • Hide UITabBarController?

    - by David.Chu.ca
    I have root view with both tab bar and navigation bar visible at the beginning. When the view is moved to the next level, I would like to hide the tab bars, and when the view is moved back, I would like the tab bar visible. Is there any way to do that?

    Read the article

  • iPhone app with tab bar and navigation bar as peers

    - by Mac
    I'm trying to write an application that uses a navigation bar and tab bar in what (I'm gathering) is an unusual manner. Basically, I've got several "pages" ("home", "settings", etc) that each have their own tab. I'd also like to have it so that the "home" page is the root view of the navigation bar, and the other pages are the second-level views of the navigation bar. That is, I should be able to navigate to any page by clicking the appropriate tab bar item, and should be able to navigate to the home page from any other page by clicking the navigation bar's back button. Currently, I have a UINavigationBar (through a UINavigationController) and a UITabBar (through a UITabController) as children of a UIView. The various pages' view controllers are set as the tab controller's viewControllers property, and the home page's controller is also set as the navigation controller's root view. Each page view's tag is set to its index in the tab control. I have the following logic in the tab controller's didSelectViewController delegate method: - (void) tabBarController:(UITabBarController*) tabBarController didSelectViewController:(UIViewController*) viewController { if ([navController.viewControllers count] > 1) [navController popViewControllerAnimated:NO]; [navController pushViewController:viewController animated:YES]; } Also, in the navigation controller's didShowViewController delegate method, I have the following code: - (void) navigationController:(UINavigationController *) navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated { tabController.selectedIndex = viewController.view.tag; } The problem that's occurring is that when I run this, the navigation bar, tab bar and home page all display ok, but the tab bar will not respond to input - I cannot select a different tab. I gather it's more usual to have the tab bar as the child of the navigation control, or vice versa. This doesn't seem to fit my approach, because I don't want to have to individually create the subordinate control each time a change occurs in the parent control - eg: recreate tab bar each time the navigation bar changes. Does anyone have suggestions as to what's wrong and how to fix it? I'm probably missing something obvious, but whatever it is I can't seem to find it. Thanks! EDIT: I'm guessing it has something to do with both controller's trying to have ownership of the page controller, but I can't for the life of me figure out a way around it.

    Read the article

  • Dismissing UIImagePickerController from UITabBarController

    - by Dave
    I have a tab bar application whereby one tab uses a navigation controller to move through a series of views. On the final view, there is a button to add a photo, which presents a UIImagePickerController. So far, so good - however when I finish picking the image, or cancel the operation, the previous view is loaded, but without the tab bar. I'm sure I'm missing something elementary, but any suggestions on how to properly release the UIImagePickerController would be much appreciated. The code is as follows: ImagePickerViewController *aController = [[ImagePickerViewController alloc]; initWithNibName:@"ImagePickerViewController" bundle:[NSBundle mainBundle]]; [self presentModalViewController:aController animated:YES]; [aController release]; //viewDidLoad self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; if([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]){ imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera; } else { imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; } [window addSubview:imagePickerController.view]; //ImagePickerViewController imagePickerControllerDidCancel - FinalViewController is the last view in the stack controlled by a navigation controller which contains the button to present the UIImagePickerController [picker dismissModalViewControllerAnimated:YES]; FinalViewController *aController = [[FinalViewController alloc initWithNibName:@"FinalViewController" bundle:[NSBundle mainBundle]]; [picker presentModalViewController:aController animated:YES]; [aController release];

    Read the article

  • NavigationBar from UINavigationController not positioned correctly

    - by David Liu
    So, my iPad program has a pseudo-split view controller (one that I implemented, not base SDK one), and was working correctly a while ago. It has the basic layout (UINavController for master, content view controller for detail on right), but I have it so the master view doesn't disappear when rotated into portrait view. Recently, I added in a UITabBarController to contain the entire split view, which has made the navigation bar go wonky, while all the other views are positioned fine. In addition, the navigation bar only gets mispositioned when the program starts up while the iPad is in landscape, or upside-down portrait. If it starts out in portrait, everything is fine. Relevant Code: RootViewController.m: - (void)loadView { navController = [[NavigationBreadcrumbsController_Pad alloc] init]; ABTableViewController_Pad * tableViewController = [[ABTableViewController_Pad alloc] initWithNibName:@"ABTableView"]; master = [[UINavigationController_Pad alloc] initWithRootViewController:tableViewController]; [tableViewController release]; // Dummy blank UIViewcontroller detail = [[UIViewController alloc] init]; detail.view = [[[UIView alloc] init] autorelease]; [detail.view setBackgroundColor:[UIColor grayColor]]; self.view = [[[UIView alloc] init] autorelease]; self.view.backgroundColor = [UIColor blackColor]; [self positionViews]; [self.view addSubview:navToolbarController.view]; [self.view addSubview:master.view]; [self.view addSubview:detail.view]; } // Handles the respositioning of view into it's current orientation -(void)positionViews{ CGFloat tabBarOffset = 0; if(self.tabBarController){ tabBarOffset = self.tabBarController.tabBar.frame.size.height; } if(self.interfaceOrientation == UIInterfaceOrientationPortrait || self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) { self.view.frame = CGRectMake(0, 0, 768, 1004); navController.view.frame = CGRectMake(0,0,768,44); //adjust master view [master.view setFrame:CGRectMake(0, 44, 320, 1024 - 44 - 20 - tabBarOffset)]; //adjust detail view [detail.view setFrame:CGRectMake(321,44, 448, 1024 - 44 - 20 - tabBarOffset)]; } // Landscape Layout else{ self.view.frame = CGRectMake(0, 0, 748, 1024); navToolbarController.view.frame = CGRectMake(0,0,1024,44); //adjust master view [master.view setFrame:CGRectMake(0, 44, 320, 768 - 44 - 20 - tabBarOffset)]; //adjust detail view [detail.view setFrame:CGRectMake(321,44, 1024 - 320, 768 - 44 - 20 - tabBarOffset)]; } }

    Read the article

  • Adding a UIPickerView over a UITabBarController

    - by Kai
    I'm trying to have a UIPickerView slide from the bottom of the screen (over the top of a tab bar) but can't seem to get it to show up. The actual code for the animation is coming from one of Apple's example code projects (DateCell). I'm calling this code from the first view controller (FirstViewController.m) under the tab bar controller. - (IBAction)showModePicker:(id)sender { if (self.modePicker.superview == nil) { [self.view.window addSubview:self.modePicker]; // size up the picker view to our screen and compute the start/end frame origin for our slide up animation // // compute the start frame CGRect screenRect = [[UIScreen mainScreen] applicationFrame]; CGSize pickerSize = [self.modePicker sizeThatFits:CGSizeZero]; CGRect startRect = CGRectMake(0.0, screenRect.origin.y + screenRect.size.height, pickerSize.width, pickerSize.height); self.modePicker.frame = startRect; // compute the end frame CGRect pickerRect = CGRectMake(0.0, screenRect.origin.y + screenRect.size.height - pickerSize.height, pickerSize.width, pickerSize.height); // start the slide up animation [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.3]; // we need to perform some post operations after the animation is complete [UIView setAnimationDelegate:self]; self.modePicker.frame = pickerRect; // shrink the vertical size to make room for the picker CGRect newFrame = self.view.frame; newFrame.size.height -= self.modePicker.frame.size.height; self.view.frame = newFrame; [UIView commitAnimations]; // add the "Done" button to the nav bar self.navigationItem.rightBarButtonItem = self.doneButton; }} Whenever this action fires via a UIBarButtonItem that lives in a UINavigationBar (which is all under the FirstViewController) nothing happens. Can anyone please offer some advice?

    Read the article

  • UITabbarController problem

    - by vinoth
    I Have two xib files named firstView and SecondView ........ I implemented these into tabbarcontroller items...Now its work fine.. When i select firsttabbaritem firstView was loaded also select second tabbaritem its loaded secondview... i have back button in the SecondView ...If some one clicked these back button means how can i load firstView?.... Can anyone help me? Thanks in advance........

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >