uitabbaritem

Can i only display text in tab bar item and change the style and position

谁说胖子不能爱 提交于 2020-01-17 09:12:07
问题 I add a tab bar in storyboard, and do not want to set an image to the tab bar item, and like the following: How can I change the font and the position for the title of the bar item in storybord? 回答1: First select the tab bar item in storyboard, than in Attributes Inspector set System Item and Title Position to Custom, so you will be able to change the position of the title by setting values to Horizontal and Vertical boxes. Finally, to change the font, in your viewDidLoad() , include:

how to add colored icon in ios swift?

可紊 提交于 2020-01-16 09:05:06
问题 I am trying to add an icon which is multicolored and when I added the icon as per in the tab bar, it is showing a single color blue, the actual colors of the icon are not visible? how should I add the colored icon in the tab bar? 回答1: In assets folder in x-code select your image and in attribute inspector change value of Render As to "Original Image" instead of "Default" . 回答2: Don't do it in the storyboard. Try this: extension UITabBarItem { convenience init(title: String, unselected: String

I can not set title to my programatically tab bar controller

空扰寡人 提交于 2020-01-16 08:55:50
问题 I try to create tab bar controller as programatically. It is ok but I can not set title to tab bar items.. How can I do this? - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. myTabBarController = [[UITabBarController alloc] init]; tab1 = [[ZiyaretFormTab1 alloc] initWithNibName:@"ZiyaretFormTab1" bundle:nil]; tab2 = [[ZiyaretFormTab2 alloc] initWithNibName:@"ZiyaretFormTab2" bundle:nil]; tab3 = [[ZiyaretFormTab3 alloc] initWithNibName:

Reload / Refresh tab bar items in a ViewController ?

痞子三分冷 提交于 2020-01-14 10:30:08
问题 I am trying to change images of my tabbar in a ViewController, but to display the new images, I must click on each tab bar item. for (CustomTabBarItem *myItem in self.tabBarController.tabBar.items){ myItem.enabled = YES; myItem.badgeValue = @"1"; UIImage *myImage = [[UIImage alloc] initWithContentsOfFile:[[DesignManager sharedManager] getPathOfFile:@"test.png"]]; *myItem.imageSelect= *myImage; // change images of each item. don't appear if I dont click on the item } Anyone know How can I can

How to change background color for tab in tvOS 13?

≡放荡痞女 提交于 2020-01-14 03:37:21
问题 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

Changing selectedImage on UITabBarItem in Swift

孤街浪徒 提交于 2020-01-12 07:55:26
问题 I've been trying to change the selected image on a UITabBar. I've followed procedures listed on other Stackoverflow questions, but nothing seems to work. I have tried setting the image through the User Defined Runtime Attributes section, as well as tried adding the following to AppDelegate.swift: var tabBarController = self.window!.rootViewController as UITabBarController let tabItems = tabBarController.tabBar.items as [UITabBarItem] var selectedImage0 = UIImage(named:"NewsfeedTabSelected")

Is it possible to change UITabBarItem badge color

妖精的绣舞 提交于 2020-01-09 06:20:30
问题 I want to change background color of UITabBarItem badge but can't find any resource on how to make it. 回答1: UITabBarItem has this available since iOS 10. var badgeColor: UIColor? { get set } It's also available via appearence. if #available(iOS 10, *) { UITabBarItem.appearance().badgeColor = .green } reference docs: https://developer.apple.com/reference/uikit/uitabbaritem/1648567-badgecolor 回答2: Changing the badge-color is now natively supported in iOS 10 and later using the badgeColor

Simulating selected tab bar effect

北城余情 提交于 2020-01-07 04:40:49
问题 Partly as a programming exercise, and partly because we may need to include such images in an app some day, I've been trying to figure out how to draw an image like the selected tab in a UITabBar . The basic operation is simple enough in concept: the icon's alpha is used as a mask to draw the blue gradient image onto the tab. (Though I can't for the life of me figure out how one actually uses an image's alpha as a mask in Core Graphics. I ended up drawing the gradient first, then using a

How to show tabbar icon full size in iPhone SDK?

怎甘沉沦 提交于 2020-01-07 04:03:26
问题 How to show image icon of tabbar in full size like in this image you can see. This is my image here you can't see the image is going to be not perfect How to show my image looks like the above image show I have used for showing image this code navigationController2.tabBarItem.image = [UIImage imageNamed:@"camera_btn"]; Hey I have found the solution for that but I can't know how to change the tabbar controllers view and i can't make my camera button like they do here I am creating tabbar

UITabbar orientation problem

风流意气都作罢 提交于 2020-01-06 08:40:35
问题 I am working on orientation work on uitabbar application. I am using 5 tabbar item in tabbar. I want only 4 tab bar item to be rotated in both Landscape and potrait. but the issue is when i put "return no" to shouldAutorotateToInterfaceOrientation in non rotating tabbar item, all tab bar are not working. can anybody please tell me what i went wrong? Thanks in advance. Regards, sathish 回答1: By default, a UITabBarController will only return YES to the shouldAutorotateToInterfaceOrientation: