uitabbarcontroller

hidesBottomBarWhenPushed makes UITabBar “jump”

◇◆丶佛笑我妖孽 提交于 2019-12-09 23:31:45
问题 I have an app with a tabbar and a navbar. I have a BaseVC and a DetailVC . I'm pushing DetailVC from BaseVC . I want the tabbar to be under the pushed VC DetailVC . I'm using hidesBottomBarWhenPushed to achieve it. It works great, but for some reason while it's animating the push the tabbar is still visible and just when the animation ends the tabbar is hidden. I want it to be under the pushed VC in the animation too. My code is: self.hidesBottomBarWhenPushed = true self.navigationController?

iPhone SDK: How to access a ViewController nested in a TabBar from MyAppDelegate?

爷,独闯天下 提交于 2019-12-09 23:11:11
问题 I'm trying to call a method in my FirstViewController that is the File Owner of the first View in a TabBar. I've tried using this line of code but just get the error "No '-showData' method found": [[tabBarController.viewControllers objectAtIndex:0] showData] But the log says that [tabBarController.viewControllers objectAtIndex:0] is my FirstViewController: 回答1: Normally what you would do is declare an IBOutlet in your app delegate that points to the view controller, then use Interface Builder

Restrict Rotation in Tab Bar View Controllers

你说的曾经没有我的故事 提交于 2019-12-09 22:28:44
问题 UPDATE 2 In my UITabBarController subclass I tried adding this: -(void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait]; [[UIDevice currentDevice] setValue:value forKey:@"orientation"]; } Now, everytime I select a tab item, the device rotates to portrait mode perfectly. However, now I can rotate the device while (a) is selected, and the device will

How can I show ViewController in UITabBarController?

泄露秘密 提交于 2019-12-09 19:05:05
问题 I have a UITabBarController and all my other view controllers are connected to it. Now I want to show one my controller as: let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc: ViewController = storyboard.instantiateViewControllerWithIdentifier("ViewController") as! ViewController but when I tried to: let rootViewController = self.window?.rootViewController as! UINavigationController rootViewController.pushViewController(vc, animated: true) it gave me the next error: Could not

UITabBarController: switch to a different view controller programmatically

让人想犯罪 __ 提交于 2019-12-09 16:33:55
问题 In my iPhone app, to restore previously viewed tab, on launch I set the setSelectedIndex: (also tried setSelectedViewController: as per docs but to no avail) This works on iPhone OS 3.0 - however on OS 2.x the selected index greater than 3 (the first 4 tabs) doesn't switch to the required view. This is documented by Apple here: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITabBarController_Class/Reference/Reference.html#//apple_ref/occ/instp/UITabBarController

Working with the same NSManagedObjectContext in multiple tabs

半城伤御伤魂 提交于 2019-12-09 14:18:00
问题 I have a tab bar controller with different view controllers all using the same managed object context, being set up as follows: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { RootViewController *rootVC = [[RootViewController alloc] initWithStyle:UITableViewStyleGrouped]; rootViewController.managedObjectContext = self.managedObjectContext; UINavigationController *rootNavCon = [[UINavigationController alloc]

Use UITabBarViewController in portrait but UISplitViewController in landscape in a Universal app

你说的曾经没有我的故事 提交于 2019-12-09 12:56:11
问题 I want to use a UITabBarViewController when on iPhone in portrait and a UISplitViewController when on iPhone 6/6+ in landscape or iPad in either orientation. When on iPad or iPhone 6/6+ landscape, the tab bar items present themselves as UITableViewCells in the topmost view controller. I would really like for the calling object to not have to worry about device or orientation, but instead pass as input the view controllers that are in the tab bar on iPhone in portrait and in the root view

Create UINavigationController in UITableViewController inside UITabBarController

我只是一个虾纸丫 提交于 2019-12-09 08:35:37
I have an application with based of UITabBarController , and inside one of the tabs I have UITableViewController to display "products", till here everything is working perfectly. Now I want when clicking one of the cells inside the UITableViewController to open a UINavigationController to display UIViewController with details of that product. I think the application hierarchy should be like the following: UITabBarController (BASE) Level-1 | |___ UITableViewController (PRODUCTS) Level-2 | |___ UINavigationController Level-3 | |___ UIViewController (PRODUCT DETAILS) Level-4 How to achieve Level

Tabbar controller with navigationcontrollers orientation ios 6

孤者浪人 提交于 2019-12-09 07:04:47
问题 I'am currently working on an project where we have a tab bar controller with 4 tabs, and where each tab have an navigation controller. On each of these navigation controller there is multiple viewcontrollers pushed on it. I read a lot of post here and other places, and we have currently done the following: Subclassed UITabbarcontroller - (BOOL)shouldAutorotate { return [[[self.viewControllers objectAtIndex:self.selectedIndex]topViewController] shouldAutorotate]; } - (NSUInteger)

Update badge of non selected tabBarItem in Swift

坚强是说给别人听的谎言 提交于 2019-12-09 04:44:30
问题 I have a navigation controller with 4 tab bar items. Each one has a navigation controller inside. I want to be able to change the 4th tab bar badge number when I get push notification, no matter in what view or tab am I. I need to use the auto-layout so I can't use any programmatically solution inside the app delegate. I started the project from a single view template. I tried to go to the desired tab, change the badge value and come back but of course it didn't work. The tabBarController