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
200
votes
15 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
  • 9,144
  • 16
  • 69
  • 121
139
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,538
  • 2
  • 9
  • 9
111
votes
11 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
  • 26,573
  • 48
  • 165
  • 294
108
votes
20 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
  • 20,957
  • 14
  • 79
  • 135
101
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
  • 30,974
  • 45
  • 160
  • 276
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,298
  • 8
  • 35
  • 32
84
votes
25 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
  • 7,700
  • 21
  • 67
  • 114
82
votes
17 answers

iOS 15 UITabBarController's tabBar background color turns black

tabBar.barTintColor can't be changed in iOS 15 beta 4. Background. We have an app in App Store and each year before the new iOS major version releases we download the iOS beta and test our app to fix the issues beforehand. Our problem. This year…
Zhengqian Kuang
  • 1,079
  • 1
  • 9
  • 12
76
votes
24 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
  • 8,280
  • 17
  • 73
  • 137
72
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,397
  • 1
  • 12
  • 30
70
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,804
  • 2
  • 15
  • 30
69
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,959
  • 7
  • 23
  • 24
69
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
  • 705
  • 1
  • 5
  • 6
66
votes
6 answers

Changing the background color of Tab Bar

I am trying to get desired color rendered in the background of Tab Bar however I am facing problems. These are the things that I tried :- Changing the background color of tab bar object from storyboard. The color rendered is always lighter than…
MrDank
  • 2,020
  • 2
  • 17
  • 39
63
votes
13 answers

calculating height of UITabBar

I'm writing an app that uses UITabBar for parts of the navigation. I'm also using UIScrollView for presenting more information than what the screen can typically handle. Because of this, I'm needing to set the scroll view to take into account the…
Matt Delves
  • 1,585
  • 2
  • 13
  • 19
1
2 3
99 100