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.

2318 questions
62
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
  • 16,211
  • 10
  • 57
  • 118
61
votes
20 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
  • 28,133
  • 34
  • 125
  • 215
60
votes
8 answers

How to get the height of the tabbar programmatically?

I've found out that the height of a UITabBar is 49px (or 50px, depending on the source). Because I don't like to use too much hard-coded values in my code I was wondering if it is possible to retrieve the height of the tabbar programmatically. Kind…
Niels R.
  • 7,260
  • 5
  • 32
  • 44
60
votes
8 answers

How do we create a bigger center UITabBar Item

I am wondering how do we create a bigger center UITabBar like the shot below? Its really beautiful!!!!
JayVDiyk
  • 4,277
  • 22
  • 70
  • 135
60
votes
4 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
  • 42,912
  • 19
  • 126
  • 165
58
votes
12 answers

Setting the default tab when using storyboards

Can anyone please tell me how to set the default tab when using storyboards in iOS. I can't seem to figure out how to accomplish this. Thank you
user1145581
  • 1,017
  • 4
  • 13
  • 18
54
votes
8 answers

ios 11 UITabBar UITabBarItem positioning issue

I have built my app using new Xcode 9 beta for ios 11. I have found an issue with UITabBar where items are spread through the UITabBar and title is right aligned to the image. I have tried changing the code to get it to work but still not…
Gihan
  • 2,476
  • 2
  • 27
  • 33
50
votes
15 answers

Hiding the tabbar and removing the space

Is there a way to hide tabbar and remove that space left (around 50px) ? I tried self.tabBarController?.tabBar.hidden = true self.extendedLayoutIncludesOpaqueBars = true No luck. I see blank space.
Utku Dalmaz
  • 9,780
  • 28
  • 90
  • 130
49
votes
20 answers

UITabBar not showing selected item images in ios 7

The icons show fine in ios 6 but not in ios 7. I'm setting the selected state in the viewController viewDidLoad method. When the user selects a tab bar item the image disappears. Here is my code: UITabBar *tabBar = self.tabBarController.tabBar; if…
user1898829
  • 3,437
  • 6
  • 34
  • 62
43
votes
12 answers

iOS 7 tabBar-line, how to remove it?

Apple has added a tiny line over the tabBar in iOS 7 which is supposed to work as a shadow or fade between the tabBar and the UI Since I am using a custom-made tabBar the line is quite irritating. How do you remove it? Please tell me it is…
43
votes
15 answers

iOS UITabBar : Remove top shadow gradient line

I implemented a custom UITabBar and I still have this gradient/shadow on top of it. I added [self.tabBar setBackgroundImage:[UIImage imageNamed:@"navBarBottom.png"]]; which is just changing the background but keeping the shadow gradient. What am I…
httpete
  • 5,875
  • 4
  • 32
  • 41
40
votes
5 answers

How to hide UITabBar?

In my app I have a tab bar. And in some views I as well have a toolbar. So when I come to those views with a toolbar it looks ugly - two bars at the bottom of the view. I thought that it would be a best solution to hide a tab bar when entering those…
Ilya Suzdalnitski
  • 52,598
  • 51
  • 134
  • 168
39
votes
13 answers

How to change UITabBar Selection color

I need to change the selection color of UITabBar from default blue to red. How do we do this.
saikamesh
  • 4,569
  • 11
  • 53
  • 93
39
votes
8 answers

Changing tab bar font in Swift

I have been trying to change the font for the tab bar items however I haven't been able to find any Swift examples. I know that this is how you change it in Objective-C: [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary…
user3746428
  • 11,047
  • 20
  • 81
  • 137
37
votes
12 answers

Changing font size of tabbaritem

Is it possible to change the font size of tabs?
4thSpace
  • 43,672
  • 97
  • 296
  • 475