What size should TabBar images be?
According to the Apple Human Interface Guidelines: @1x : about 25 x 25 (max: 48 x 32) @2x : about 50 x 50 (max: 96 x 64) @3x : about 75 x 75 (max: 144 x 96)
According to the Apple Human Interface Guidelines: @1x : about 25 x 25 (max: 48 x 32) @2x : about 50 x 50 (max: 96 x 64) @3x : about 75 x 75 (max: 144 x 96)
There’s a project on github called BCTabBarController that aims to mimic the tab bar used in Twitter for iPhone. It’s got some of the things you’re looking for, and should give a great starting point.
BarButtonItem (iOS11\xCode9) uses autolayout instead of frames. Try this (Swift): if #available(iOS 9.0, *) { cButton.widthAnchor.constraint(equalToConstant: customViewButton.width).isActive = true cButton.heightAnchor.constraint(equalToConstant: customViewButton.height).isActive = true } Objective C if (@available(iOS 9, *)) { [cButton.widthAnchor constraintEqualToConstant: standardButtonSize.width].active = YES; [cButton.heightAnchor constraintEqualToConstant: standardButtonSize.height].active = YES; }
There are two things you need to do for this: 1) If you want to customize the TabBar itself, you need to set the barTintColor for the tabBarController: // this will generate a black tab bar tabBarController.tabBar.barTintColor = [UIColor blackColor]; // this will give selected icons and text your apps tint color tabBarController.tabBar.tintColor = appTintColor; … Read more
You have to use set the hidesBottomBarWhenPushed property to YES on the controller that you are pushing and NOT to the UITabBarController. otherController.hidesBottomBarWhenPushed = YES; [navigationController pushViewController: otherController animated: TRUE]; Or you can set the property when you first initialize the controller you want to push.
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()
From UITabBarItem class docs: By default, the actual unselected and selected images are automatically created from the alpha values in the source images. To prevent system coloring, provide images with UIImageRenderingModeAlwaysOriginal. The clue is not whether you use UIImageRenderingModeAlwaysOriginal, the important thing is when to use it. To prevent the grey color for unselected items, … Read more
Thats because UIBarButtonItem image’s default rendering mode always draw the image as a template image, ignoring its color information (UIImageRenderingModeAlwaysTemplate). Just create your image using UIImage’s method imageWithRenderingMode always original. UIImage(named: “yourImageName”)!.withRenderingMode(.alwaysOriginal)
Solution You need to subclass UITabBarController and then add the button above TabBar‘s view. A button action should trigger UITabBarController tab change by setting selectedIndex. Code The code below only is a simple approach, however for a full supporting iPhone (including X-Series)/iPad version you can check the full repository here: EBRoundedTabBarController class CustomTabBarController: UITabBarController { … Read more
I am maintaining a large iPad app written mostly in Objective-C that has survived several iOS releases. I ran into the situation where I needed the pre-iOS 11 tab bar appearance (with the icons above the titles instead of next to them) for a couple tab bars. My solution was to create a subclass of … Read more