Questions tagged [uitabbar]

UITabBar is a user interface element in Apple's iOS, which is a bar at the bottom of the screen and has images and/or text representing different views of an application.

UITabBar

UITabBar - iOS Class (Apple Docs)

Class Structure = UITabBar : UIView : UIResponder : NSObject

A UITabBar is a common user interface element used in constructing multi-view applications. Each tab/button may contain text or an image, and when pressed corresponds to a , or a subclass of (such as a ).

Image: screenshot of the UITabBar in Apple's Health application.

UITabBar Example


The object which controls a Tab Bar, is a . This class manages the view swapping that occurs when the user selects another tab.

2257 questions
187
votes
14 answers

Change tab bar item selected color in a storyboard

I want to change my tab bar items to be pink when selected instead of the default blue. How can i accomplish this using the storyboard editor in Xcode 6? Here are my current setting which are not working, the blue background works but the pink…
Deekor
  • 8,371
  • 13
  • 64
  • 112
137
votes
32 answers

iOS 11 iPhone X simulator UITabBar icons and titles being rendered on top covering eachother

Anyone having issue with the iPhone X simulator around the UITabBar component? Mine seem to be rendering the icons and title on top of each other, I'm not sure if I'm missing anything, I also ran it in the iPhone 8 simulator, and one actual devices…
adrian chen
  • 1,518
  • 2
  • 7
  • 9
108
votes
19 answers

iPhone: How to switch tabs with an animation?

I'm switching tabs programmatically in a tab bar driven application using UITabBarController.selectedIndex. The problem I'm trying to solve is how to animate the transition between the views. ie. from the view of the current tab to the view of the…
drekka
  • 18,723
  • 12
  • 67
  • 112
103
votes
9 answers

Moving UITabBarItem Image down?

Normally on each tab of a UITabBar you have a small image and a title naming the tab. The image is positioned/centred towards the top of the tab to accommodate the title underneath. My question is: if you want to have a tabBar with just an image and…
fuzzygoat
  • 25,797
  • 45
  • 159
  • 288
99
votes
6 answers

What size should TabBar images be?

I have icons for a tabBar of size 100. I checked at Apple's Human Interface Guidelines of 2013 and it says the image size should be 30x30 / 60x60. But as the height of tab bar controller is 50, I kept the size of the image at 50x50. Now, when I run…
Fahim Parkar
  • 28,922
  • 40
  • 153
  • 260
87
votes
18 answers

Changing Tint / Background color of UITabBar

The UINavigationBar and UISearchBar both have a tintColor property that allows you to change the tint color (surprising, I know) of both of those items. I want to do the same thing to the UITabBar in my application, but have found now way to change…
pixel
  • 5,269
  • 8
  • 33
  • 32
77
votes
22 answers

Changing tab bar item image and text color iOS

Here is my tab bar: The following image shows the program being run and the "NEWS" item selected: It is clear the bar tint color is working fine as I want ! But the tintColor only affects the image and not the text. Also, when the an item is…
Greg Peckory
  • 6,660
  • 15
  • 61
  • 101
70
votes
19 answers

Change UITabBar height

I use UITabBarController as a root view and app supports iOS 6 and above. Project class hierarchy is as below. UITabBarController - tab1 - UINavigationController - UIViewController - UIViewController . . - tab2 -…
Geek
  • 7,950
  • 15
  • 68
  • 132
68
votes
4 answers

TabBarItems and setting their image sizes?

I am currently adding images to each one of my tab bar items. One image I like has a size that is much bigger then the area of the bar item. When I set the image of the bar item in the storyboard and run the emulator... the bar button with that…
MooCow
  • 1,245
  • 1
  • 11
  • 28
65
votes
15 answers

How to hide tab bar with animation in iOS?

So I have a button that is connected to a IBAction. When I press the button I want to hide the tab bar in my iOS app with a animation. This [self setTabBarHidden:hidden animated:NO]; or this [self.tabBarController setTabBarHidden:hidden…
b3rge
  • 4,529
  • 7
  • 20
  • 23
62
votes
14 answers

Unselected UITabBar color?

I have an UITabBar with 5 items. I want to change the unselected color of all items. The items aren't declared in the UIViewController classes (i built them and linked the views in the Storyboard). Is there an code like this : [[UITabBar appearance]…
user1530090
  • 635
  • 1
  • 5
  • 6
61
votes
12 answers

UITabBar items jumping on back navigation on iOS 12.1

I have an iOS app with UITabBarController on a master screen, navigating to a detail screen hiding the UITabBarController with setting hidesBottomBarWhenPushed = true. When going back to the master screen the UITabBarController does a strange "jump"…
Igor Kulman
  • 15,893
  • 10
  • 51
  • 114
60
votes
19 answers

How to change inactive icon/text color on tab bar?

How can I change inactive icon/text color on iOS 7 tab bar? The one in gray color.
Pablo
  • 24,270
  • 32
  • 112
  • 196
58
votes
3 answers

What's the height of a UITabBar on iOS 8, iOS 9, iOS 10, and iOS 11?

The height of the UITabBar seems to have changed between iOS 7 and 8/9/10/11. I'm posting this question for others to easily find the answer. So: What's the height of a UITabBar on iOS 8/9/10/11 on iPhone and iPad?
Johannes Fahrenkrug
  • 38,500
  • 17
  • 113
  • 155
57
votes
6 answers

Detect when a tab bar item is pressed

I have a root view controller which isn’t set as the custom class for any of my view controllers on my storyboard. Instead, all of my view controllers are subclassing this class like so. // RootViewController class RootViewController:…
Tunds
  • 1,607
  • 2
  • 11
  • 27
1
2 3
99 100