uitabbaritem

I need Expert Advice on this implementation of UITabBarController

守給你的承諾、 提交于 2019-12-11 05:04:54
问题 I am currently in need of 8 TabBarItems , and I can show just 4 items in view. And I need to be able to scroll to the next 4 tabBarItems. In the default behavior of the UITabBar, you normally get a 'MORE' tabbaritem for more than 5 tab bar items. I want it to be the Scroll Button in place of the MORE button. So ~ ~If I press the scroll button (or the fifth) tabBarItem, it should display 4 more tab bar items with a back scroll button. These are my ways of doing this - - Implementing a Scroll

Change Default “Not Selected” UITabBarItem Image Color

霸气de小男生 提交于 2019-12-11 03:55:16
问题 how do we change the "Not Selected" or the unhiglighted state of the icons in UITabBarItem? I tried setting the UITabBarItem.appearance().setTitleTextAttributes(:) but it only changes the text color. Any idea? 回答1: If you want to change the default in iOS 7 and above, you have to actually use different icons (in the color you like to have for unselected tabs) and set the color of the text. Instead of creating two sets of icons, you could apply this tweak: // set the selected colors [self

Disable rotation for one UITabbar item

房东的猫 提交于 2019-12-11 03:20:46
问题 I have a uitabbarcontroller with 4 tab bar items and each tab bar item has a uinavigationcontroller. I needed to lock the orientation of one uitabbar item only to Portrait. So i implemented the following code: Created a custom tab bar controller and added the following code in it: MainTabBarController.m -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // You do not need this method if you are not supporting earlier iOS Versions return [self

iOS7 tab bar custom icon height - height reduces until icon gets invisible

自闭症网瘾萝莉.ら 提交于 2019-12-10 19:18:27
问题 I implemented tab bar with custom icon sizes to match the design: The first and the last icon sizes are reduced to fit below the circle line by setting the bar item sizes as follows: The strange behaviour that happens only on iOS7+ is that when the user taps already active resized tab bar icon for the second time - it gets reduced in size: And if I tap on it again - it's size is so small that it appears invisible: This doesn't happen on iOS5 or iOS6. Is there something that I'm doing wrong

how to add UITabBarItem programmatically?

别说谁变了你拦得住时间么 提交于 2019-12-10 16:49:03
问题 In my application, i have added UITabBarController in "Storyborad". But now i want to add UITabBarItem programmatically. Let's say there are 5 buttons and when ever user click on that button my UITabBarController is called. There are total 5 tab in "tabbar". e.g: Tab name:item1,item2,item3,item4,item5. Button name:item1,item2,item3,item4,item5. Let's say user click on item1 button, UITabBarcontroller is called. Now user should not be able to see that item1 tab in "tabbarcontroller", he should

How do you customise the title on a UITabBarItem?

大兔子大兔子 提交于 2019-12-10 12:56:23
问题 When using the method initWithTabBarSystemItem to create a UITabBar object is there a way to set the title? I've tried setting the title property (on the viewController and tab bar item) afterwards but it doesn't seem to make a difference. I know about the initWithTitle: image: method but I want to use one of the system icons with a custom title. 回答1: If yo are using the systemItem you can't customize it, you will have to make a custom Item, and use the same or similar artwork... you could

UITabBarItem title position

心不动则不痛 提交于 2019-12-10 04:19:12
问题 On searching the web on how to adjust the position of a UITabBarItem title position i ran over this similar post and still wondering how to do that. Is it even possible to adjust the title position a bit from the bottom up? (for example 5px) I need this because i have custom images and now the position of the title is not perfect. 回答1: Why don't you just have an empty title property for your view controller and add the title to your custom images for the tab? You can do this (in iOS 5.0):

Remove UITabBarItem

风流意气都作罢 提交于 2019-12-09 12:53:52
问题 How can I remove a UITabBarItem from a UITabBar ? I haven't tried anything, because I haven't found anything from Google searches or the documentation for UITabBar , UITabBarController , or UITabBarItem . Thanks in advance! :) 回答1: UITabBar has an NSArray collection of items. Since the items property is an NSArray and not an NSMutableArray, you'd have to construct a new NSArray from the existing one devoid of the object you want to remove, then set the items property to the new array. /*

iOS 5: UITabBarItem setFinishedSelectedImage:withFinishedUnselectedImage: not working / ignored

你。 提交于 2019-12-09 01:47:16
问题 As per Apple docs I'm trying to set custom finished selected and unselected images on a UITabBarItem like so: ... DetailViewController *vc1 = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:nil]; UITabBarItem *vc1i = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemTopRated tag:100]; [vc1i setFinishedSelectedImage:[UIImage imageNamed:@"tab_bar_item_selected.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"tab_bar_item_normal.png"]]; [vc1 setTabBarItem

How to add “more” button to Tab Bar?

不想你离开。 提交于 2019-12-09 01:45:52
问题 My iPhone app has a tab bar controller at the bottom of the view - and at the moment I have three buttons on it. However, I want to add more, but to do so I need to turn the last of the three buttons into a "More..." button, because otherwise the text on the other buttons runs into each other. I know that if you have over 5 buttons in the tab bar, then it automatically creates a more button - but is there a way to manually invoke this with the editing capabilities? Thanks. 回答1: You do not