How to get the height of the tabbar programmatically?
I don’t totally understand your P.S., but you can do: tabBarController?.tabBar.frame.size.height
I don’t totally understand your P.S., but you can do: tabBarController?.tabBar.frame.size.height
You can set the UIViewController.hidesBottomBarWhenPushed instead: DetailViewController *detailViewController = [[DetailViewController alloc] init]; detailViewController.hidesBottomBarWhenPushed = YES; [[self navigationController] pushViewController:detailViewController animated:YES]; [detailViewController release];
You can also set the property Render As of your tab bar images within your asset catalog directly. There you have the option to set the property to Default, Original Image and Template Image.
To change background colour of UITabBar TabBarController* Tcontroller =(TabBarController*)self.window.rootViewController; Tcontroller.tabBar.barTintColor=[UIColor yourcolour]; Swift 3 Based on the code above, you can get it by doing this let Tcontroller = self.window.rootViewController as? UITabBarController Tcontroller?.tabBar.barTintColor = UIColor.black // your color or in more general UITabBar.appearance().barTintColor = UIColor.black // your color
You don’t want your view controller’s base class to be a UITabBarDelegate. If you were to do that, all of your view controller subclasses would be tab bar delegates. What I think you want to do is to extend UITabBarController, something like this: class MyTabBarController: UITabBarController, UITabBarControllerDelegate { then, in that class, override viewDidLoad and … Read more
When working with storyboard its easy to setup the View Controller to hide the tabbar on push, on the destination View Controller just select this checkbox:
In iOS 10 and higher, there are 3 possible easy solutions: A. Instance from code (Swift): self.tabBar.unselectedItemTintColor = unselectedcolor B. Instance from IB: Add a Key Path: unselectedItemTintColor of type: Color C. Global appearance (Swift): UITabBar.appearance().unselectedItemTintColor = unselectedcolor
I faced this issue and I was able to solve it. You have to add following code to your subclass of UITabBarController class. const CGFloat kBarHeight = 80; – (void)viewWillLayoutSubviews { [super viewWillLayoutSubviews]; CGRect tabFrame = self.tabBar.frame; //self.TabBar is IBOutlet of your TabBar tabFrame.size.height = kBarHeight; tabFrame.origin.y = self.view.frame.size.height – kBarHeight; self.tabBar.frame = tabFrame; } … Read more
First drag A TabBarController from Object Library you see that only two tabs with thier VC there. to add more Tab Item in TabBarVC drag VC from Object Library Then Control drag from TabBarVC to Newly VC then Segue relation pop ups Select last one Relationship Segue -> View Controllers
I had the same issue and found the same link that is in your question. I used the same approach for the tab bar. This is the code i am using and it works perfectly. if #available(iOS 15.0, *) { let appearance = UITabBarAppearance() appearance.configureWithOpaqueBackground() appearance.backgroundColor = customColor self.tabController.tabBar.standardAppearance = appearance self.tabController.tabBar.scrollEdgeAppearance = view.standardAppearance }