uitabbar

Move UITabBar to the top of a UITabBarController?

旧城冷巷雨未停 提交于 2019-11-30 16:23:05
I just finished designing a application that uses a top bar that toggles between three UIViewControllers. My first thought was to use a UITabBarController, since it works very simular. However, the tabBar is at the bottom and in my PSD, it's at the top. Is there anyway I can change it? I see in the library I can drag in a UITabBar, but I don't know how to get it to change pages from there. Please help! Coulton I think it can be done, but you should be aware of this : "Important: In iPhone OS 3.0 and later, you should not attempt to use the methods and properties of this class to modify the tab

Move UITabBar to the top of a UITabBarController?

微笑、不失礼 提交于 2019-11-30 16:08:34
问题 I just finished designing a application that uses a top bar that toggles between three UIViewControllers. My first thought was to use a UITabBarController, since it works very simular. However, the tabBar is at the bottom and in my PSD, it's at the top. Is there anyway I can change it? I see in the library I can drag in a UITabBar, but I don't know how to get it to change pages from there. Please help! Coulton 回答1: I think it can be done, but you should be aware of this: "Important: In iPhone

Swift 2.2 How to change background color of tab bar controller

五迷三道 提交于 2019-11-30 15:18:32
问题 I've been trying to change the background of the tab bar, and have read many posts here in ObjC, many of them quite old. But I didn't find any for Swift, which is what I'm using. I finally figured out how to do it from code, so the tab bar colors can be changed with each theme color change. Here are the references that I used: override func viewWillAppear(animated: Bool) { // set tab bar background color, including the More tab self.tabBarController?.tabBar.backgroundColor = UIColor.blueColor

How to change UITabBarController More button's title?

▼魔方 西西 提交于 2019-11-30 14:36:26
I have a Tab Bar app. The app has 8 UITabBarItems and the More button is added automatically. I want to change the title from More to something else. I have already tried the following: tabbarController.moreNavigationController.tabBarItem.title=@"Test"; But it still displays "More". No error. No changes. How can I change the "More" text to another? The label under the "More" button is localized for you based on the user's current Locale as specified in their Settings. However, you have to declare your support for that locale in your app's Info.plist. Add the CFBundleLocalizations key to your

Changing tab bar font in Swift

ε祈祈猫儿з 提交于 2019-11-30 14:33:13
问题 I have been trying to change the font for the tab bar items however I haven't been able to find any Swift examples. I know that this is how you change it in Objective-C: [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"AmericanTypewriter" size:20.0f], UITextAttributeFont, nil] forState:UIControlStateNormal]; But how can I translate this into Swift? 回答1: The UITextAttributeFont was deprecated in iOS 7. You should use the NS

Swift 2.2 How to change background color of tab bar controller

ε祈祈猫儿з 提交于 2019-11-30 13:37:51
I've been trying to change the background of the tab bar, and have read many posts here in ObjC, many of them quite old. But I didn't find any for Swift, which is what I'm using. I finally figured out how to do it from code, so the tab bar colors can be changed with each theme color change. Here are the references that I used: override func viewWillAppear(animated: Bool) { // set tab bar background color, including the More tab self.tabBarController?.tabBar.backgroundColor = UIColor.blueColor() } I put this code in the view controller for the first tab that appears when the app starts up, so

Setting default tab in UITabBar in swift

安稳与你 提交于 2019-11-30 13:25:29
问题 I'm almost finished with a project and am working out the last few UI kinks. My app uses a tab bar to navigate and for aesthetic purposes I want the app to open on the last tab (User Profile) instead of the first. I know I can reorder the tabs in Interface Builder but the tab bar would just look odd having the profile tab first and the home tab anywhere else. How can I leave the profile tab as the 5th tab yet by default open the app on that tab? 回答1: Just set the selectedIndex of the

Show UITabBar when UIViewController pushed

你说的曾经没有我的故事 提交于 2019-11-30 11:40:47
问题 Here's my situation : I have a UINavigationController inside a UITabBarController . When I drill down the navigation controller, at some point I have to hide the UITabBar because I want the view to have as much space as possible. I do that by using self.hidesBottomBarWhenPushed = YES inside the pushed UIViewController , and it works quite well. However, I want to show the UITabBar back in the following pushed controllers. I've tried to put self.hidesBottomBarWhenPushed = NO in the other

How to change the unselected tabbaritem color in iOS7?

喜你入骨 提交于 2019-11-30 10:26:21
Before iOS 7 I used [[UITabBar appearance] setTintColor:[UIColor redColor]]; But now it only paint the selected item, I have read some suggestions but I can not fin how to do it, I used this too: [self.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"openbookwp4.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"openbookwp4.png"]]; this put the icon I want, with the color I want, but only after I selected that tab for example, when I open the app the tab looks normal, but after I press the second tab and return to the first, the second tab now has the color I want. It is hard to

Setting default tab in UITabBar in swift

谁说我不能喝 提交于 2019-11-30 09:32:15
I'm almost finished with a project and am working out the last few UI kinks. My app uses a tab bar to navigate and for aesthetic purposes I want the app to open on the last tab (User Profile) instead of the first. I know I can reorder the tabs in Interface Builder but the tab bar would just look odd having the profile tab first and the home tab anywhere else. How can I leave the profile tab as the 5th tab yet by default open the app on that tab? Just set the selectedIndex of the tabBarController. Something along these lines. var freshLaunch = true override func viewWillAppear(animated: Bool) {