uitabbar

Keeping controls in landscape mode but allowing uitabbar to switch

拟墨画扇 提交于 2019-12-12 14:16:39
问题 I have a UITabBar switches places when the iphone changes orientation and that works fine, but I want the controls within the view of the first tab to stay static regardless of the position of the phone. I feel like I'm missing something obvious? Edit: Basically, the controls are always landscape but the tab bar must switch orientations. It this possible? 回答1: For the view in which you don't want the controls to readjust, disable the autoresizing: [self.view setAutoresizesSubviews:NO]; . This

How to definitively set UITabBar background color and UITabBar tint color

非 Y 不嫁゛ 提交于 2019-12-12 07:41:05
问题 I have been trying to set my UITabBar 's tint color and background color for quite some time now and nothing seems to work. So far I have tried: tabBarController?.tabBar.backgroundColor = UIColor.orangeColor() tabBarController?.tabBar.barTintColor = UIColor.whiteColor() as well as: UITabBar.appearance().tintColor = UIColor.orangeColor() Neither of these seemed to have any effect on my tab bar. I'd also like to mention that I have the VC embedded in a navigation controller for which the global

custom TabBar loses TabBarItem images

谁都会走 提交于 2019-12-12 06:57:19
问题 I have made a custom UITabBar that is working very well, but I introduced a change to navigation and now i am having some serious issues. Here is what I have: General Setup TabBarController NavbarController1 - TabBarItem1 Links to: PeopleView NavbarController2 - TabBarItem2 Links to: ContentView NavbarController3 - TabBarItem3 Links to: ContentView //Same VC as TabBaritem 2. App Delegate - In my didFinishLaunchingWithOptions method I call a customizeTabBar method as follows -(void)

UITabBar appears 20 pixels down?

老子叫甜甜 提交于 2019-12-12 06:15:27
问题 I have created a UITabBarController and adding to a UIViewController subview. My code is implemented programmatically. The UITabBar is showed up 20pixels down the view. UITabBarController *tabCtrl_obj = [[UITabBarController alloc]init]; [self.view addSubview:tabCtrl_obj.view]; How should i solve it? 回答1: It's the status bar that's doing it. Sometimes if you add a view directly to the window it can behave oddly - generally it means you have to define more elements of the view yourself. Try

How to programmatically change UITabBar selected index after Dismiss?

南笙酒味 提交于 2019-12-12 05:14:41
问题 I have a modal UIViewController over the UITabBarViewcontroller and i want to dismiss it, then change the selected item of my tab bar. I'm trying to accomplish it by setting the selectedIndex inside dismiss' completion: self.dismiss(animated: true, completion: { self.tabBarController?.selectedIndex = 2 }) I apologize if this is a newbie question, i just couldn't find the solution to this anywhere. Thanks in advance for every answer, clue or old similar questions that you send me :) 回答1: I was

iOS tabbed application with table view, how to reset table view tab? Beginner.

戏子无情 提交于 2019-12-12 03:22:56
问题 I have a tabbed application with 3 tabs The first tab is a table view The second and third tabs are single page views When a user clicks on a table cell in view one a new view is pushed on with a back button to the table cell. Now lets say they click tab 2, then back to tab 1. The new view that was pushed on tab 1 is still visible. What I would like is to have the table view "reset" when they navigate away from it with another tab so that when they return they are presented with the table

Segue from one ViewController to another ViewController inside a Tab Bar Controller?

送分小仙女□ 提交于 2019-12-12 03:17:55
问题 In the interface builder I have a UITabBarController and it is set as the initial view controller. From the tab bar controller, I have linked three independent ViewControllers; two UIViewController 's and one UITableViewController . I have embedded all three of these views inside UINavigationController 's as each of these views will eventually segue to a new view. Interface Builder Problem: I now want to link one of the UIViewController 's to the UITableViewController using a button to segue

UITabBarItem Change Image Height and Width

柔情痞子 提交于 2019-12-12 02:33:38
问题 I have a UITabBarItem without a title and only an image. I was wondering how I can change the image size so it can take up the whole UITabBarItem. I searched all over the internet but found nothing. I tried: UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main_Storyboard" bundle:nil]; UITabBarController *tabBarController = [storyBoard instantiateViewControllerWithIdentifier:@"tab"]; UITabBar *tabBar = tabBarController.tabBar; UITabBarItem *tabBarItem1 = [tabBar.items

Tab bar shows alert message

笑着哭i 提交于 2019-12-12 02:28:36
问题 My app has four tabs 3 of them moves to a separate view controller . The fourth one enable the user to log out from the app what i need here is to add an alert message when the fourth tab is pressed can any one help me how to do so ? I did search for solutions and found nothing . Thanks in advance 回答1: first make sure your appdelegate.h file contains the UITabBarControllerDelegate to be able to access UITabBar methods .. so the definition of your AppDelegate.h should look like this @interface

Set Action for UITabBarItem

纵然是瞬间 提交于 2019-12-12 02:15:28
问题 How can i set an action for my UITabBarItem ? Can i connect it from storyboard to code somehow? or programmatically? And if so how can it be done? My hierarchy is UITabBarController -> UINavigationController -> UITabBarItem Sorry for the noobish question but i really need an answer for this. And I couldn't find anything regarding this online. Using Swift 3 and Xcode 8 Thank you! i tired Mannopson's Answer (didn't work): class BarsViewController: UITableViewController,UISearchResultsUpdating