uitabbarcontroller

Sharing the Same UIViewController as the rootViewController with Two UINavigationControllers

早过忘川 提交于 2019-12-20 09:57:09
问题 Update: I have decided to go a different route with my problem. Instead of trying to reuse the same UIViewController directly, I use two vanilla UIViewControllers that are set as rootViewControllers . In their loadView methods, they make a call to [storyboard instantiateViewControllerWithIdentifier:] to get the former UIViewController and set their views to the controller's view. This is probably the preferred approach anyway, since I need to set several variables and delegates. I have a

How do I change background color of UITabItem when item is selected

為{幸葍}努か 提交于 2019-12-20 09:47:50
问题 I would like a different background color when the user selects a tab bar item than when it is unselected. 回答1: Put this in the Appdelegate.m in application didFinishLaunchingWithOptions UIImage *whiteBackground = [UIImage imageNamed:@"whiteBackground"]; [[UITabBar appearance] setSelectionIndicatorImage:whiteBackground]; 回答2: if you use a storyboard or xibs, click "Tab Bar" and add "selectedImageTintColor" path into the Key Path Attributes tag. Like this : 回答3: UPDATE: As of iOS 7.1 this

Adding a TabBarController as the Subview of a View

夙愿已清 提交于 2019-12-20 09:32:55
问题 I am loading a splash screen when my app starts. Then I want to load a TabBarController and it's ViewControllers. However, my TabBarController window does not scale to the screen size. Probably 3/4 of the TabBar at the bottom is getting cut off and There is a slim aprox 20 pixel gap at the top of the screen below the status bar. How do I resize the TabBarController properly? Here is the code in my SplashViewController loading the splash view, and the TabBarController: -(void)loadView{ // Init

Custom rightBarButtonItem disappearing

半城伤御伤魂 提交于 2019-12-20 06:37:23
问题 I have a strange bug with a custom rightBarButtomItem in the NavBar. I have a TabBar application. If the app is loaded the button shows up correct. If i click through the tabs the button keeps showing. If i go back to one of the tabs which was already shown the button disappears. At the end the button only shows randomly in one of the tabs. My code works perfectly if i set a standard rightBarButtomItem programatically. But not with custom graphics. If a ChildViewController is pushed and

Prevent UITabBar to hide when pushed

送分小仙女□ 提交于 2019-12-20 05:45:35
问题 First let me tell about my app scenario. UINavigationController {relationship} UIViewControllerMain {push} UITabController {push} UIViewControllerOne . Here problem is tab bar hides in UIViewControllerOne . How can i make it visible? 回答1: self.tabBarController.tabBar.hidden = NO; 来源: https://stackoverflow.com/questions/12244816/prevent-uitabbar-to-hide-when-pushed

UITabBarController's 'More' navigation controller disappears under UINavigationController

梦想与她 提交于 2019-12-20 05:40:58
问题 I am using a UITabBarController as well as a UINavigationController on my app. In my UITabBarController I am using more than 5 items so I automatically get the 'More' item. I've managed to add a saving procedure so the order of those items will be kept in case somebody changes the order etc. With 'More' active I get the More navigation controller with the 'Edit' item positioned under my UINavigationController. Both navigation controller are visible. When I click on 'Edit though the More

Alternative to subclassing UITabBarController

心不动则不痛 提交于 2019-12-20 05:17:06
问题 It seems that UITabBarController should not be subclassed. How would you recommend that I implement a TabBarController in a rotatable DetailView? Thank you! 回答1: You can add to your controller a delegate to <UITabBarDelegate> , create a tabBar programmatically UITabBar * aTabBar; and fill it with UITabBarItems and then implement this function to handle the touch on a tab to switch views - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item { } This is in brief parts of the code

iPhone one title for all view controllers

最后都变了- 提交于 2019-12-20 05:15:17
问题 I have an app with tab bar controller (with 4 views controller) and it contains a navigation controller. All of this was create programmatically. My question: Is there a way how to set one navigation bar title for all view controllers ? For example: When i switch tabs, title is the same. Ideal solution for me is set title in app delegate file. Thanks a lot 回答1: If you know that there will be exactly 4 views controller, just do self.title = @"your title"; If you want to change "your title"

can't make tab bar hidden when using container views

强颜欢笑 提交于 2019-12-20 04:38:32
问题 My app uses view controllers each containing 2 container views as intermediaries between a tab bar controller and navigation controllers. This is for the purpose of managing a menu that is embedded in one of the container views in each intermediary. I need to hide the tab bar (aka bottom bar). I have tried sending setHidesBottomBarWhenPushed:YES to every view controller, and I have tried selecting "hides bottom bar on push" in the storyboard for every VC. Why aren't these things working? I

My Tab bar controller disappears after a push segue

陌路散爱 提交于 2019-12-20 04:10:16
问题 Here is the setup of my app: Navigation- -loginVC -if login is valid, pushes segue to- tab bar controller with 3 tabs: -in the first tab, is a profile display which modal pushes to a profile editor(not issue here) -second tab is a searchVC that pushes to a tableVC that shows results. This is where the tab bar disappears -The third view is just a VC for updating the database this is linked to. This is literally how it works on the storyboard, and I've made sure the segue from the searchVC to