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
0
votes
1 answer

Swift -Tabbar item frame is returning questionable value when converting frame to window

I have a tabBar with 5 items. To get the frame of the first tabBar item and set something based on that frame I use this which works perfectly: guard let firstTab = tabBarController?.tabBar.items?[0].value(forKey: "view") as? UIView else { return } …
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
0
votes
0 answers

iOs: How to get a scale factor minimum in a UITabBarItem?

I would like to have an adaptative text in my UITabBarItem that minimize the font size if it get too large. For example: Here is my code: UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.font: UIFont(name: "Read-Regular",…
ΩlostA
  • 2,501
  • 5
  • 27
  • 63
0
votes
3 answers

UITabBar more button navigation issue

In my app I nearly have 10 tab items which end up adding a more button to the tab bar. When I select the more button it list the other tab bar contents as a list. I select one of them and navigate inside (this has a navigation controller) and click…
Dilshan
  • 3,231
  • 4
  • 39
  • 50
0
votes
1 answer

Change tabBarItem image programmatically

Using iOS14.0.1, Swift5.3, Xcode12.0.1, I would like to dynamically change the image of a UITabBarController's tabBarItem Here is my code: self.tabBarCtrl?.viewControllers?[2].tabBarItem.image = #imageLiteral(resourceName:…
iKK
  • 6,394
  • 10
  • 58
  • 131
0
votes
1 answer

Is there a way to change the image position in UITabBar or UITabBarItem?

So, I created the image too big for the TabBarItem, and parts of the image appear beyond the top of the TabBar Image here I could: Resize all the images in the Image.xassets Write a function to resize the image so it fits in the TabBarItem area I…
Terry
  • 1
0
votes
1 answer

how to controll over tabbarview controller?

I've a problem that in my tabbarviewcontroller there are many viewcontroller in a particular tab button.I want that when I press tab button it should come first viewcontroller regarding that tab button not the current viewcontroller of that tab…
0
votes
1 answer

Selected tabBar item transparent background in Swift

Here are two colors I have: static let mainDarkBlue = UIColor(r: 40, g: 51, b: 86) static let mainDarkBlueTransparent = UIColor(r: 40, g: 51, b: 86, a: 0.8) I have mainDarkBlue set for a barTint color and that's fine, but there is…
stackich
  • 3,607
  • 3
  • 17
  • 41
0
votes
1 answer

reload UIwebview from tabBarItem

what i need is when someone clicked on tabBarItem 0 it will reload the page I have tabBarController in my AppDelegate.m file my problem is how to call webview in MainView.m to reload i use code to check which tabBarItem was clicked and its work…
Bosoud
  • 158
  • 4
  • 24
0
votes
3 answers

View Controller1 in a TabBarController won't automatically update view after ViewController2 is dismissed

SCENARIO Xcode 11.5, Swift 5 Using Core Data User wants to update their profile. VC2 is dismissed after user taps save. VC1 area highlighted in yellow should reflect the change. PROBLEM Data is being saved correctly. However, VC1 elements…
adrapp
  • 47
  • 6
0
votes
4 answers

UINavigation Controller and UITabbarController connumdrum

I have searched and searched but as yet still cannot figure this ole problem out! :-( I have in my main.xib a TabBarController that is setup with five viewControllers. I am trying to get the first viewcontroller to be a nav controller so that if the…
0
votes
1 answer

How do I make a tabbar item available only for a specific target?

I have a tabBarController with three items to different viewControllers. There are four targets in my projects and for one of the targets I would like to add a new tabBar item that goes to newViewController. The item shouldn't show up when I run the…
0
votes
2 answers

TabBar is not showing TabBar Item title Swift 5

i am try to add title to my tab bar items, but it is not showing don't know why fileprivate func appenedVC(for rootViewController: UIViewController,tabBarTitle: String, image: UIImage) -> UIViewController { let navController =…
Umer Khan
  • 193
  • 12
0
votes
2 answers

How can I set the tabBarItems to different colours?

I've got a tabBar setup with 5 tabBarItems all going to different view controllers. I've set the project up so that when a tabBarItems is not selected, it is a grey tint color on both the text and image (I'm using system default images). What I am…
JPountney
  • 11
  • 4
0
votes
1 answer

iOS 3 - UITabBarItems disappear from UITabBar after a memory warning occurs

At a great number of requests from people using older iOS hardware, I'm currently refactoring and optimizing my app so it will work on iOS 3. That being said I've got a glitch with my UITabBar that I can replicate on all of the iPhone 3G units I've…
TiM
  • 15,812
  • 4
  • 51
  • 79
0
votes
1 answer

How to programmatically change the default icon used by a tab bar item?

I have a TabBar item that is a shopping cart outline called "cart". This is a default icon provided by XCode. With the tab of a button, I want to change this icon to another default icon provided by XCode called "cart.fill" shoppingCartIcon.image =…
helloworld12345
  • 176
  • 1
  • 4
  • 22