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
6
votes
3 answers

How do you connect a tab bar item to an action?

I have a UIView which has a UITabBar with 4 UITabBarItem components in it (all created from IB). I want my IBAction function called when someone clicks on the items in the tab bar. But I am unable to connect the tabbaritem to my action via IB... I…
DeShawnT
  • 479
  • 2
  • 7
  • 12
6
votes
2 answers

Set UITabBarItem title programmatically?

My app is based on a tab bar architecture. In order to have an easy internationalisation mechanic, I do not write any string in XIB files. viewdidload permits to change programmaticaly the strings in the views. When my app launches, I can see the 4…
kheraud
  • 5,048
  • 7
  • 46
  • 75
6
votes
3 answers

UITabbar item title/name disappear for the second tab

I have a tabbar controller in my iphone app. Everything was fine until the second tabbar item is clicked. When its clicked, the tabbaritem title/name under the tabbar icon for the second tab will disappeared. But there's no problem with the first…
sicKo
  • 1,241
  • 1
  • 12
  • 35
6
votes
6 answers

Set TabBar Item badge count with SwiftUI

Is it possible to show TabItem badge with SwiftUI? It is easy to achieve with UIKit like described here -> How to set badge value in Tab bar? I didn't find a way to do this with a SwiftUI. The only possible way is to access to UITabBarController…
Julian D.
  • 321
  • 4
  • 11
6
votes
3 answers

How to center a SF Symbols image vertically in UITabBarItem?

I am using SF Symbols images as tab images in my iOS app by assigning them as follows: self.tabBarItem.image = UIImage(systemName: "ellipsis") This results in all images being top-aligned, but I would like to have them centered vertically. What…
iosdeveloper
  • 195
  • 1
  • 1
  • 7
6
votes
1 answer

Find Out Default Font Size of Title for UITabBar?

I have a UITabBarController. It has two tabs. They are labelled "FirstTitle" and "SecondTitle." How can I find out what the default font size for these titles are? In ViewDidLoad, for my first View Controller, which corresponds to my first tab, I…
Everett
  • 387
  • 1
  • 4
  • 17
6
votes
1 answer

Center Button Tab Bar

Here is what I am trying to do: The screenshot is taken from an 5s IPhone. The screenshot is taken from an 6s IPhone. Image Set From Main Storyborad : In first picture the center button is all good but i am really confused center button…
Sham Dhiman
  • 1,348
  • 1
  • 21
  • 59
6
votes
1 answer

Change tab bar badge size in Swift

How to change the tab bar badge size? I set the tab bar badge value with position tabBarController?.tabBar.items?[4].badgeValue = "1" but I can't change the red circle tab bar badge size. Thank you!
Rinku Vashist
  • 355
  • 3
  • 14
6
votes
2 answers

TabBarController for music program

I use tabBarController to create a music program and I have questions like how to do it as shown in gif Questions: How to do so that when you click on tabBarItem, "presentViewController" worked How to make it so that the photo does not change…
Vasya2014
  • 203
  • 1
  • 5
  • 25
6
votes
2 answers

how to change disabled item color in TabBar in swift 3?

I have a TabBar in my project and when user select item this item will disable but the color will change too! I want the color is same as other items color in TabBar I used item.isEnabled = false for disable item but this codes here won't work…
Saeed Rahmatolahi
  • 1,317
  • 2
  • 27
  • 60
6
votes
4 answers

Remove spacing between tab bar items (left and right)

How to remove spacing between tab bar items when using the "fill" value on the "item position" option? I've tried the following: let tabBarController = window!.rootViewController as! UITabBarController tabBarController.tabBar.itemSpacing =…
user3427013
  • 1,039
  • 1
  • 13
  • 28
6
votes
3 answers

Scroll to top UITableView with double tap on UITabBarItem

I want to simulate the behaviour of twitter or instagram in their list: When double tap in UITabBarItem, the list is scrolling to top. Somebody knows how can I do this? I have 4 items in my UITabBarController, all of them are list, so I want to do…
Dasoga
  • 5,489
  • 4
  • 33
  • 40
6
votes
2 answers

IOS - When tapped on a tab item, I need to check condition to show other view controller

In my app, I have UITabBarController, when user tapped on a tabbar item (e.g: tab index is 3), I want to check one condition (if...) to show different ViewController. So my question is where to implement this condition function?
QuocTV
  • 199
  • 1
  • 8
6
votes
3 answers

Customizing text color AND font of UITabBarItem causing weird result in swift

I am trying to change the text of my UITabBarItems and have used questions such as this. The second answer works great for me unless I try to adjust the font of the UITabBarItem. This snippet produces the expected results of the selected text being…
JCode
  • 1,788
  • 3
  • 12
  • 29
6
votes
5 answers

iOS : How to add Underline in UITabBarItem

I am working in a application where i need to add underline in UITabbarItem. so i would like to add underline under the selected UITabbarItem in Default UITabbarcontroller of iOS. I have already created subclass of UITabbarcontroller but didn't find…
Malav Soni
  • 2,739
  • 1
  • 23
  • 52