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
1
vote
2 answers

How to decrease vertical padding between UITabBarItem image and text?

I would like to decrease the vertical padding between the UITabBarItem and its text: ie in order to make it look like this: I tried this code: let pStyle = NSMutableParagraphStyle() pStyle.lineSpacing = -10.0 …
abbood
  • 23,101
  • 16
  • 132
  • 246
1
vote
1 answer

How to hide one tab in tab bar controller?

I am using Xcode 10.1 and Swift 4.2.1. I have Tab Bar app like this: For some reasons I want to hide/delete one of the bars to receive something like this: So, the question is: how to hide one Tab of Tab Bar? To specify: some button pressed, one…
Alex
  • 1,038
  • 2
  • 12
  • 32
1
vote
1 answer

How to add border to UITabBar Badge?

How to add a custom border to the badge in the tab bar item? By default it shows a red dot in the top right corner of the tab bar item. I want to add a border to it. There is an option to change the color of the badge but I could not find anything…
1
vote
1 answer

UITabbar image moving up down

My UITababarController image moving up down when I am coming back from any controller back to UITabbarController. You can check the following the link for the…
Abhijit Hadkar
  • 210
  • 2
  • 11
1
vote
1 answer

swift - how switch between two viewcontrollers from one tabBarItem , and customize it?

I'm stacked with so standart question, but can't find any working example. I have TabBar(added at storyboard) at my app, and it looks like [Home, Log In, ...]. And the point is about second TabBarItem. There could be 2 cases: 1) user logged in -…
nastassia
  • 807
  • 1
  • 12
  • 31
1
vote
1 answer

Open a Pop Up from bottom when tab bar item is clicked in Swift 3?

How to show Bottom PopUp when TabBar index 2 is clicked and hide when "close" button inside PopUp is clicked and also when popup shows tab bar will be hidden.Could someone help me i am new to iOS development.Thanks in advance.
1
vote
1 answer

Objective-C: How to properly set didSelectViewController method for TabBarController, so I can refresh the VC everytime it is tapped

Trying to accomplish Tap on the tabbaritem and it will called the respective method on the tabbaritem VC. Issue When I tap on tabbaritem2 it will call didSelectViewController on tabbaritem2 and then the respective method. Then when I tap on…
Hanz Cheah
  • 761
  • 5
  • 15
  • 44
1
vote
2 answers

Programmatically center icons in a TabBarItem in a UITabBarController

I'm programmatically generating a UITabBarController (instantiating view controllers and assigning them to my UITabBarController's viewControllers array). I don't want titles for my TabBarItems. However, the TabBarItems by default make space for a…
user644809
  • 11
  • 2
1
vote
1 answer

Set UITabBarItem badge value in appDelegate

I've done a bunch of searching on this question, and found numerous answers to accomplish this in Objective-C. However, I've yet to find an answer that is in Swift. I've tried translating the Objective-C, with the following code executed in…
Alex Ritter
  • 1,009
  • 3
  • 18
  • 40
1
vote
0 answers

UITabBarButton not taking accessibilityIdentifier

I am setting the accessibilityIdentifier for our tabBarItem from programmatically. I am creating tabBar programmatically and only set the image of tabBarItem. In iOS 9.x this worked fine and we could reference the correct tab bar button. In iOS 10…
1
vote
1 answer

Items of UITabBarController not showing

I am trying to implement bottom navigation bar for my iOS application. However, when I am creating tabBarItem, it is not showing on TabBar. TabBar is displaying correctly. I cannot figure out where is the problem, any help will be very…
Reindl
  • 23
  • 7
1
vote
1 answer

How can I set different UITabBarItems for the same storyboard reference included twice in a UITabBarController?

I have a UITabBarController containing four view controllers. The first two of these are storyboard references to the same external storyboard: "BookTable" in the image below. I want to set different tab bar icons for these two items, but I can't…
Andrew Bennet
  • 2,600
  • 1
  • 21
  • 55
1
vote
2 answers

ipad - TabBarItem image cropping

As seen below, my image is being cropped, yet there appears to be enough space to render it. As well, the image seems to be at the top. I have no title set so want no text there. How can I get the button to center and fit the image?
Ian Vink
  • 66,960
  • 104
  • 341
  • 555
1
vote
1 answer

UITabbar Appearance Chang in iPad and iPhone

I have added tabbar control to my view controller through the story board, with following constraints.. As i required the selection indicator image for the selected item i am using following code in viewDidLayoutSubviews method override func…
Jaydeep Vyas
  • 4,411
  • 1
  • 18
  • 44
1
vote
2 answers

Change tabbar selected item from another view controller

I am new to Swift (using 4 version) and I want to change tab bar item from another view controller (not tab bar controller). This is my scheme: From RouterViewController (used for side menu navigation) in didSelectRowAt i'm doing this: func…
Vadim
  • 335
  • 3
  • 14