uitabbaritem

How to change background color for tab in tvOS 13?

瘦欲@ 提交于 2019-12-08 13:41:38
TvOS 13. I have a UITabBarController with tabs. And can customize almost everything except this obvious thing: focused tab's background. It's always white. Guide tells Specify tints for selected and unselected items I tried: view.backgroundColor = .purple tabBar.tintColor = .yellow tabBar.barTintColor = .red tabBar.unselectedItemTintColor = .brown tabBar.backgroundColor = .green tabBar.backgroundImage = UIColor.blue.toImage() tabBar.shadowImage = UIColor.orange.toImage() tabBar.selectionIndicatorImage = UIColor.burgundy.toImage() Nothing helped. After playing a bit with various properties of

UITabBarItem image created in code doesn’t appear

杀马特。学长 韩版系。学妹 提交于 2019-12-08 11:15:00
问题 I create the following View in code, the idea is to use it as an image in UITableViewCell and UITabBarItem : - (void)drawRect:(CGRect)rect { // Fill the background with white CGContextRef context = UIGraphicsGetCurrentContext(); UIColor * whiteColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]; CGContextSetFillColorWithColor(context, whiteColor.CGColor); CGContextFillRect(context, self.bounds); //// Color Declarations UIColor* fillColor = [UIColor colorWithRed: 1.0 green: 1.0

Adding additional UITabbarItem to UITabbarController

こ雲淡風輕ζ 提交于 2019-12-08 09:10:42
问题 I am wondering if there is a way to add an additional UITabBarItem to my exisiting UITabBarController . It doesn't need to be in runtime. All I want to do is when hitting this button I want to presentModalViewController: over my actually visible ViewController, which should either be the TabBarController or its controllers. Hopefully this is clear enough, if not, feel free to ask. 回答1: As a result of my research you cannot add a UITabBarItem to a UITabBar that is managed by a

Custom UITabBar unselected item's color

ぐ巨炮叔叔 提交于 2019-12-08 02:58:34
问题 I am trying to change the default grey colour of the unselected UITabBarItems. I have managed to change the text but not the image. TabBar.appearance().barTintColor = UIColor(red: 86.0/255.0, green: 132.0/255.0, blue: 208.0/255.0, alpha: 1.0) var normalTint: UIColor = UIColor.whiteColor() TabBar.appearance().tintColor = UIColor.whiteColor() UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: normalTint,NSFontAttributeName: UIFont(name: "Arial", size: 13)!],

Tab bar item icons appear darker

扶醉桌前 提交于 2019-12-07 19:47:59
问题 When setting the icons for the tab bar items it seems that the icons are appearing darker for some reason. Examples below Tab bar in app What it should be like from designs As you can see in the second example the colours are softer and lighter compared to the ones above i can't seem to figure out why because even in my image.xcassets the icons look like the ones in the design and in my setting in the identity inspector shown below there doesn't seem to be any settings for tints. Storyboard

UITabBarItem action not working

我只是一个虾纸丫 提交于 2019-12-07 12:47:54
问题 I am trying to create a sort of action bar so I restored to using a tab bar because it is clean and is less of a hassle. All 5 of the tabs will be doing some kind of action but with the current code I have it is not doing anything and I am unsure why. I have the UITabBarDelegate added in my class class DetailViewController: UIViewController, MKMapViewDelegate, UITabBarDelegate I have the tab bar set @IBOutlet weak var optionsBar: UITabBar! And this is the code I was hoping would print out the

Custom action when clicking on UITabBarController

邮差的信 提交于 2019-12-07 03:13:29
问题 I have a Tab Bar Controller with four navigation controllers added to it. The navigation controllers appear as Tab Bar Items in the Tab Bar Controller. Now I want to add a fifth button to the tab bar, that does not open another view, but triggers some custom code. I want to display an overlaying "share menu" when clicking that Tab Bar Item regardless on which of the four pages the user is. How can I do that? 回答1: I can suggest to add dummy UIViewController to the last index and handle

setTitleTextAttributes doesn't work for UITabBarItem when it is unselected in swift

独自空忆成欢 提交于 2019-12-06 12:41:54
问题 I am trying to custom my UITabBarController . I have it embedded in my UIViewController , I also created a class for this UITabBarController . override func viewDidLoad() { super.viewDidLoad() //custom tab bar self.tabBar.barTintColor = UIColor(red: 0.0/255.0, green: 102.0/255.0, blue: 153.0/255.0, alpha: 1) self.tabBar.tintColor = UIColor(red: 171.0/255.0, green: 203.0/255.0, blue: 61.0/255.0, alpha: 1) self.tabBarItem.setTitleTextAttributes([NSForegroundColorAttributeName: UIColor

Max number of UITabBar items allowed in iPhone SDK?

前提是你 提交于 2019-12-06 11:09:25
问题 I currently have 8 UITabBar items, all of which are editable in the More view. My question is, what is the absolute maximum number of tab bar items allowed? I understand 5 is the most that can be visible at one time; I'm looking for the most you can have period. 回答1: I don't think there is a hard limit, as long as you don't run out of memory. I've used more than 20 in the past without any problems (although having many controllers means you should be really careful when managing memory, i.e.

How to change the color of unselected tab bar items in iOS 7?

本秂侑毒 提交于 2019-12-06 07:54:35
Im trying to change the color of the unselected images in the tab bar, by default they are changed to gray, even if the image is another color. I already search this, but the answers are only for iOS 6 or below. This drove me mad just recently so I wrote my own class to handle it that works with every version of iOS I've tried it on ;) Its really easy to extend to do whatever you want it to do too! GozTabBar.h: #import <UIKit/UIKit.h> #import "GozTabBarItem.h" @protocol GozTabBarDelegate; @interface GozTabBar : UIView { UITapGestureRecognizer* pTapGestureRecognizer; } @property UIColor*