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
26
votes
11 answers

How can I change the top border of my UITabBar?

I'd like the UITabBar to have a top border of width 5.0. The border should be yellow color. I don't want any left/bottom/right borders. The Tab Bar border should be flat (no shadows or anything like that). How can I remove shadow (image) line?
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
26
votes
8 answers

Detect UITabBar Selected Index/ Item Changes that is set Programmatically

I would like to know how do we detect when the selected TabBar Item or Index is changed when the changes is done programmatically? self.tabBarController.selectedIndex = 1; This two delegate function only detect changes when the tabBar Item was…
JayVDiyk
  • 4,277
  • 22
  • 70
  • 135
25
votes
3 answers

How to change the highlight colour of tabbar icons? (iPhone/iPad)

I have been looking around online for an answer to this question for several days now with no success. Essentially what I want to do is change the highlight colour of the icons in my UITabBar. By default they are highlighted in blue when selected,…
user843337
24
votes
3 answers

Set background color of active tab bar item in Swift

I'm hoping to accomplish this without the use of images, if at all possible. Is there a way to create the effect shown in the image programmatically without have to render each tab out as an image? Every question I've reviewed on SO has the tabs…
matcartmill
  • 1,573
  • 2
  • 19
  • 38
24
votes
9 answers

How to set the Tab bar item 1 to be selected by default in iphone?

I am new to iPhone development. I am creating a view based application. I have added a tab bar in my view (and not a tab bar controller). By setting the tag vale of the tab bar item to 1, 2, I have loaded the view for each tab bar on tabbar item…
Warrior
  • 39,156
  • 44
  • 139
  • 214
24
votes
7 answers

Preventing a UITabBar from applying a gradient to its icon images

When I make icons for a UITabBar, it applies a gradient to the images. I need to know how to prevent it from having this gradient.
obsoleteModel81
23
votes
6 answers

Tab bar not showing icons?

I read a bunch of related questions, I tried what they said, nothing works really. Not sure why. So, I have 3 different UIStoryboards. First one is the Auth Storyboard that handles Login/Register and there's a storyboard reference to the second…
Dani
  • 3,427
  • 3
  • 28
  • 54
23
votes
7 answers

iOS - Getting desired shadow above UITabBar

I am trying to get my tab bar shadow to look like the one seen in this image: What is the best way of doing this? I am using objective-c Thanks
rohinb
  • 408
  • 2
  • 4
  • 15
23
votes
9 answers

Only image as UITabBarItem

I would only like to have an icon as the UITabBarItem and not the text underneath and I was wondering if this was possible, if so, how? TIA
user437038
22
votes
1 answer

iOS8/Swift: Tab Bar Item getting smaller on click

I just encountered a weird bug when giving insets to my Tab Bar images. When I click the image in the built version, the image will apply the inset every time i click it -> so if you click it 3x it will basically disappear - if you click another Tab…
longbow
  • 1,593
  • 1
  • 16
  • 39
22
votes
2 answers

Accessing UITabBarController from UIVIewController

I am developing an application based on UITabbar and the view hierarchy as follows. UITabBarController ----> UINavigationController ----> UIViewController I need to access the UITabBarController from the UIIVewController . But following properties…
rustylepord
  • 5,681
  • 6
  • 36
  • 49
22
votes
3 answers

UINavigationBar appearance refresh?

In my iPad app I have an application settings view. One of the options lets the user switch interface color scheme. The settings view is loaded by segue to a separate view controller than my "main" app's window. When they pick a new color I switch…
Kent
  • 1,705
  • 3
  • 16
  • 26
22
votes
11 answers

How do I change background color of UITabItem when item is selected

I would like a different background color when the user selects a tab bar item than when it is unselected.
user2290869
21
votes
4 answers

Make custom button on Tab Bar rounded

Here is what I am trying to do: Note: The screenshot is taken from an earlier version of iOS What I have been able to achieve: Code: override func viewWillAppear(animated: Bool) { // Creates image of the Button let imageCameraButton:…
Supratik Majumdar
  • 2,365
  • 1
  • 23
  • 31
21
votes
5 answers

How to add a badge to a UITabBar that is customizable?

I am adding a badge to my UITabBarController's UITabBar as such: UITabBarItem *tbi = (UITabBarItem *)[stTabBarController.tabBar.items objectAtIndex:1]; tbi.badgeValue = @"2"; However, my UITabBarController is customizeable, so the index may change.…
Sheehan Alam
  • 60,111
  • 124
  • 355
  • 556