Questions tagged [uitabbaritem]

The UITabBarItem class implements an item on a tab bar, instances of the UITabBar class. Tab bar items are used to configure the tab bar.

Tab bar items gives the ability to switch between different subtasks, views, or modes. A tab bar operates strictly in radio mode, where one item is selected at a time—tapping a tab bar item toggles the view above the tab bar. There is a way to specify a badge value on the tab bar item for adding additional visual information—for example, the Phone application uses a badge on the item to show the number of new messages. This class also provides a number of system defaults for creating items.

991 questions
9
votes
7 answers

How to adjust tab bar badge position?

I'm displaying badge on tab bar but when number increase it goes out to tab bar item like shown in image I want to move the badge view slightly left so it fit on selected tab image.i tried as described here but no luck. So is there is any way to…
Blios
  • 719
  • 1
  • 16
  • 30
8
votes
5 answers

Multiple lines in UITabBarItem Label

I've tried many things but impossible to find a way to put the label of a UITabBarItem with a lineNumber customised.0 (i would like to get the title on 2 lines). Is there a way to do it?
Kevin Vacquier
  • 622
  • 6
  • 17
8
votes
5 answers

Swift - How to change UITabBarItem badge font?

I have a UITabBar. I set a value for tab bar items: tabBarItem3?.badgeValue = String(self.numberOfProducts) Now I want to change its font to a specific font. Then I used this code : tabBarItem3?.setBadgeTextAttributes([NSFontAttributeName:…
socratesss
  • 81
  • 1
  • 3
8
votes
4 answers

How to refresh Tab Bar Items in swift ios

I do app like Instagram with tab bar items. In app I have simple user and company user. I have main ViewController: MainTabBarController: UITabBarController with 5 tab bar items. And each item has own ViewController I need refresh…
Janserik
  • 2,306
  • 1
  • 24
  • 43
8
votes
5 answers

How to change UITabBarItem Badge position?

This is how my Tabbar is looking right now. How do I move that badge so that it overlaps the top right of the bell icon? Any help is appreciated.
Drunken Daddy
  • 7,326
  • 14
  • 70
  • 104
8
votes
9 answers

Is there a way to use a custom selected image for UITabBarItem?

I like to have a custom selected image when a user selects an item on the tab bar, by default it selects as blue like but would like to have a green color instead. something like below any thoughts?
Frank
  • 3,073
  • 5
  • 40
  • 67
8
votes
1 answer

How can I decrease the size of a UI Tab Bar Item Image so that it fits inside the Tab bar?

This is for a tab bar for an iPhone app, using the Swift coding language in Xcode 6.3 My issue is that I want to add an image into my Tab bar in one of my view controllers, but the image is too large. My original solution to this was to manually…
TW80000
  • 1,507
  • 1
  • 11
  • 18
8
votes
2 answers

iOS Disable popping to root view on pressing tab bar button

I'm looking to disable the functionality of pressing my tab bar and returning to the root view in the navigation hierarchy whilst also keeping this functionality for a button in my navigation bar. So the only way I want the user to go back to the…
8
votes
6 answers

Change only one specific UITabBarItem tint color

It is well known that the tint color of selected (or active) items in a UITabBarController can be easily changed, here is an example: myBarController.tabBar.tintColor = [UIColor redColor]; In this instance, any tab bar item in tabBar will have a…
element119
  • 7,475
  • 8
  • 51
  • 74
8
votes
2 answers

How to remove space below the UITabBarItem?

I have created a tabBar and set image in it, but it leaves too much space below the tabBarItem. How can I remove that? This is my tabBar than displaying right now And I want to display it like this To display Tabbar firstVC = [[FirstViewController…
user2452016
8
votes
3 answers

Is it possible to remove the images in the UITabBarItem and aligned vertically the title

I have a UITabBar but i don't want to set the images I just want to set the title, and I want this title to be aligned vertically. Is this possible? Thanks
Pach
  • 861
  • 11
  • 18
7
votes
3 answers

UITabBarItem.title vs. UINavigationController.title

I allocated a UITabBarItem with a title (initWithTitle) and connected it to a UINavigationController. I found out that if the navigation controller's root view controller has its own title, then that title permanently replaces the title specified on…
Amiram Stark
  • 2,208
  • 22
  • 32
7
votes
2 answers

How do you customise the title on a UITabBarItem?

When using the method initWithTabBarSystemItem to create a UITabBar object is there a way to set the title? I've tried setting the title property (on the viewController and tab bar item) afterwards but it doesn't seem to make a difference. I know…
Tom
  • 73
  • 3
7
votes
2 answers

UIEdgeInsets not working on System Images in TabBar

I am using XCode System Images (SF Symbols) for UITabBarItem Images. I'd like to remove the UITabBarItem Title which I have done. But also move the UITabBarItem Image down slightly. In the past when I wasn't using System Images this would work…
David Henry
  • 1,972
  • 20
  • 43
7
votes
2 answers

SwiftUI TabBar Color

How can one set the tabbar color? Assigning the color black results only with a grey bar for example. This is for SwiftUI. Specify dark mode is not a suitable work around. struct ContentView: View { @State private var selection = 1 …
Yarm
  • 1,178
  • 4
  • 16
  • 29