iOS 7 tabBar-line, how to remove it?
UIImage* tabBarBackground = [UIImage imageNamed:@”tabbar_bg.png”]; [[UITabBar appearance] setShadowImage:tabBarBackground]; [[UITabBar appearance] setBackgroundImage:tabBarBackground];
UIImage* tabBarBackground = [UIImage imageNamed:@”tabbar_bg.png”]; [[UITabBar appearance] setShadowImage:tabBarBackground]; [[UITabBar appearance] setBackgroundImage:tabBarBackground];
The problem is with this specific constraint which is between the view and the top of the bottom layout guide. Select the constraint and edit its “Second Item” property Here you need to choose bottom Once you have that, the pink view is not influenced by layout guide anymore. The layout guide seem to acknowledge … Read more
Similary in answer for this question … if You don’t want to mess with any kind of 1×1 transparent image, this work’s too: [[UITabBar appearance] setBackgroundImage:[[UIImage alloc] init]]; [[UITabBar appearance] setShadowImage:[[UIImage alloc] init]]; In swift: UITabBar.appearance().shadowImage = UIImage() UITabBar.appearance().backgroundImage = UIImage()
UPDATE SWIFT 5 One example of how to create an UITabBarController programmatically could be like this: First we create the UIViewControllers that will be the content for each tab of the tab bar interface. For this example we only create one very simple. class Item1ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = UIColor.green … Read more
There’s a nice example of switching views in Chapter 6 of Beginning iPhone Development. You can see the source code for it here: http://iphonedevbook.com/ SwitchViewController has the code to change views programatically. – (IBAction)switchViews:(id)sender { if (self.yellowViewController == nil) { YellowViewController *yellowController = [[YellowViewController alloc] initWithNibName:@”YellowView” bundle:nil]; self.yellowViewController = yellowController; [yellowController release]; } [UIView beginAnimations:@”View … Read more
Hi you need to embed each view controller that is within the tab bar in a navigation controller of its own. So the flow is like so (HomeVC is embedded in a NavController of it’s own): / –> `NavController` –> `ViewController1` | –> `NavController` –> `ViewController2` `HomeViewController`–>`TabBarController`|–> `NavController` –> `ViewController3` \–> `NavController` –> `ViewController4` Go … Read more
Thats pretty simple tabBarController is declared as an optional type var tabBarController: UITabBarController? { get } The nearest ancestor in the view controller hierarchy that is a tab bar controller. If the view controller or one of its ancestors is a child of a tab bar controller, this property contains the owning tab bar controller. … Read more
Whilst you can set the initial selected tab programmatically like the other answers, to achieve the same in your storyboard without touching code you would perform the following: Select the Tab Bar Controller in the Storyboard Interface Show the Identity Inspector in the Utilities panel Add a new “User Defined Runtime Attribute” Set the Key … Read more
Click the tab bar button within the view controller of the particular tab bar item you want to make prominent, Remove the text, just set the image inset top to -25 of the tab bar button. Like Below image After that goto assets, select the image you set in tab bar button, set the property … Read more
If you got the reference to the tabBarController (e.g. from the UIViewController) you can do the following: if let tabItems = tabBarController?.tabBar.items { // In this case we want to modify the badge number of the third tab: let tabItem = tabItems[2] tabItem.badgeValue = “1” } From a UITabBarController it would be tabBar.items instead of … Read more