uitabbar

how to change tabBar icon color in ios

。_饼干妹妹 提交于 2019-11-28 12:18:14
My current tab bar looks as follows: My code is as follows: -(void)startTabBar{ self.tabBarController = [[UITabBarController alloc] init]; TAB_1 *tab_1 = [[TAB_1 alloc]init]; TAB_2 *tab_2 = [[TAB_2 alloc]init]; TAB_3 *tab_3 = [[TAB_3 alloc]init]; [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor blackColor], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal]; [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], NSForegroundColorAttributeName,nil] forState

UITabBar change background color of one UITabBarItem on iOS7

岁酱吖の 提交于 2019-11-28 12:17:38
Can I change the background color of a specific UITabBarItem in a UITabBar ? I know how to change all the background of the selected background, using: [[UITabBar appearance] setBarTintColor:[UIColor redColor]]; [[UITabBar appearance] setTintColor:[UIColor blueColor]]; [[UITabBar appearance] setSelectedImageTintColor:[UIColor yellowColor]]; But can it be done for only one item without subclassing? Thanks You can add a subview to the parent tabBar, and set a background color on the subview. You can use the tabBar frame dimensions to calculate the offset and width of your tabBarItem, and then

Customize the More UIBarButtonItem in UITabBar

一个人想着一个人 提交于 2019-11-28 11:51:00
Since iOS 5 Apple provided an API to customise the UITabBarItems in the UITabBar object. I am refering specifically to the following selector: setFinishedSelectedImage:withFinishedUnselectedImage: It all works great for regular buttons but I can't seem to customise the "More" button to match the style of the other ones. This is what I am doing: tabBarController.viewControllers = tabBarControllerArray; tabBarController.moreNavigationController.navigationBar.tintColor = [UIColor blackColor]; UITabBarItem *more = tabBarController.moreNavigationController.tabBarItem; if ([more respondsToSelector:

Change UITabBar tint colors in the More menu

被刻印的时光 ゝ 提交于 2019-11-28 11:42:43
I'm trying to change the blue colour from icons in the more menu. I tried almost everything I found on Stack Overflow, but nothing worked. I tried this solution , but is not working. The only option I found to change the colour was [[UIView appearance] setTintColor:[UIColor redColor]]; but it changes all colours in the app. The code is just a new project with storyboard, so I just added the views on the storyboard. Thanks for helping. Edit: After I added the code: UIImage *myImage = [[UIImage imageNamed:@"music.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; self.tabBarItem =

How to remove programmatically a tab bar item created in parent class NIB file?

感情迁移 提交于 2019-11-28 11:03:26
Within my iPhone application I have a common tab bar with three tabs that is presented from several views after pressing a button. The approach I followed was the workflow of Tweetie application, described in Robert Conn post . Note that the main controller is a navigation controller; the tab bar is placed in a view controller's NIB file of the navigation stack, and the effect of switching between tabs is handled in a delegate didSelectItem method. @interface GameTabBarController : UIViewController<UITabBarDelegate> { UITabBar *tabBar; UITabBarItem *lastGameTabBarItem; UITabBarItem

How can I have a popover come from a tab instead of a view

北城余情 提交于 2019-11-28 10:30:56
问题 I have a tabbar app, and I want a popover to come from one of the tabs. Is there a good/easy way to do this without changing views? 回答1: There isn't currently a way to directly (through a supported api call) get the frame of a specific tab bar item. What I do is just show the popup from the left end of the tab bar like this: CGFloat tabBarHeight = self.tabBarController.tabBar.bounds.size.height; CGRect rect = CGRectMake(0, 0, tabBarHeight, tabBarHeight); [popoverController

iOS5 TabBar Fonts and Color

孤街醉人 提交于 2019-11-28 09:11:01
I have customized the TabBar appearance such UIImage *tabBackground = [[UIImage imageNamed:@"tab-bar-bg.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; [[UITabBar appearance] setBackgroundImage:tabBackground]; [[UITabBar appearance] setSelectionIndicatorImage: [UIImage imageNamed:@"activetab.png"]]; How do I define the custom fonts and the selected and unselected text colors? Thanks, [[UITabBarItem appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: [UIColor blackColor], UITextAttributeTextColor, [UIFont fontWithName:@"font" size:0.0],

UItabBar changing View Controllers

眉间皱痕 提交于 2019-11-28 07:44:25
问题 i have some difficulties changing tab bar controllers. Basically I have UITabBarController with 3 controllers. First time when app starts. I change one controller like this: NSMutableArray *muteArray = [[NSMutableArray alloc] init]; FirstPage *online; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { online =[[FirstPage alloc] initWithNibName:nil bundle:nil]; }else{ online =[[FirstPage alloc] initWithNibName:nil bundle:nil]; } //adding all controllers of tab bar to array [muteArray

How do you connect a tab bar item to an action?

别说谁变了你拦得住时间么 提交于 2019-11-28 07:43:38
问题 I have a UIView which has a UITabBar with 4 UITabBarItem components in it (all created from IB). I want my IBAction function called when someone clicks on the items in the tab bar. But I am unable to connect the tabbaritem to my action via IB... I control drag from the "received actions" but it does not allow me to connect that to the tabbaritem. Thanks Deshawn 回答1: It is not clear from your question if you also defined a UITabBarController. If you did not (as I assume, otherwise clicking on

To change the color of unselected UITabBar icon in iOS 7?

╄→尐↘猪︶ㄣ 提交于 2019-11-28 06:54:11
I know this question has been asked earlier as well, but still i didn't get any solution searching the solution on internet. I referred the following posts: How can I change the text and icon colors for tabBarItems in iOS 7? Only able to change the selected icons color using tintColor . How to change the color of unselected tab bar items in iOS 7? In this they have written their own GozTabBar class inherited from UIView I want to changes the default gray color of UITabBar icon when its in unselected state. Any help would be highly appreciated. Thanks in advance. Inertiatic I'm assuming that