uitabbaritem

How to set tab bar item title programmatically in objective c?

别等时光非礼了梦想. 提交于 2019-12-02 17:27:26
I want to set title to tab item programatically, but it not works. My code is below: - (IBAction)tab1Click:(id)sender { myTabBarController = [[UITabBarController alloc] init]; view2Controller = [[View2Controller alloc] init]; [view2Controller setTitle:@"title"]; view3Controller = [[View3Controller alloc] init]; deneme = [[ViewController alloc] init]; myTabBarController.viewControllers = [NSArray arrayWithObjects:deneme, view2Controller,view3Controller, nil]; [self.view addSubview:myTabBarController.view]; myTabBarController.selectedIndex=1; } Aitul You can set all the UITabBar icons in an easy

iOS 7 tabBar-line, how to remove it?

£可爱£侵袭症+ 提交于 2019-12-02 17:00:20
Apple has added a tiny line over the tabBar in iOS 7 which is supposed to work as a shadow or fade between the tabBar and the UI Since I am using a custom-made tabBar the line is quite irritating. How do you remove it? Please tell me it is possible, otherwise I need to redesign my whole app lol.... / Regards *Edit Sloved my problem with the following line of code: [[UITabBar appearance] setShadowImage:[[UIImage alloc] init]]; UIImage* tabBarBackground = [UIImage imageNamed:@"tabbar_bg.png"]; [[UITabBar appearance] setShadowImage:tabBarBackground]; [[UITabBar appearance] setBackgroundImage

How can I remove the blue square that overlays UITabBarItem when selected?

我们两清 提交于 2019-12-02 16:27:07
问题 I have an iPad app (Xcode 5, iOS 7, ARC and Storyboards). I have a UITabBarController , and each scene has a UITabBarItem . When I tap a tab bar item, it goes to the correct scene, but the "current" tab bar item image is overlaid by a "blue box". How can I replace that "blue box" with a different image? (I don't want to change the color; I want to replace it with a different image). 回答1: The images you use for a tab bar item have to have their renderingMode be,

How can I change a color of image and label on UITabBar on iOS 7.1?

梦想与她 提交于 2019-12-02 15:52:58
问题 How can I change a color of image and label on UITabBar on iOS 7.1? On iOS 7 I could make it by Tint property. But on iOS 7.1 it doesn't work. 回答1: This changes the tint of both the image and the label, when selected. - (void)viewDidLoad { [super viewDidLoad]; [[UITabBar appearance] setTintColor:[UIColor redColor]]; } 回答2: It works in the same way in iOS 7 and iOS 7.1! In AppDelegate: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

Is there anyway to add same scroll menubar at the navigation bar?

◇◆丶佛笑我妖孽 提交于 2019-12-02 13:00:31
I have already posted my this problem another time but i have not got my answer perfectly.Here i am going to explain my problem another time, it is very important for me so at any cost i have to solve it.Now my problem is... Suppose, I have 4 tabbaritem in a tabbarController and items "dashboard","order","product","customer". every item of these tabbar is a calling there respective uiviewcontroller . dashboar calling "DashboarViewController"; order calling "orderViewController"; product calling "ProductViewController"; customer calling "CustomerViewController"; Now, i have to set a scrolling

How to get the tag of selected UITabBarItem in UITabBarController for more than 5 items?

耗尽温柔 提交于 2019-12-02 11:16:11
问题 In Storyboard I created UITabBarController with 6 relationships to another view controllers. So now I have 6 UITabBarItems . I tagged them from 0 to 5 . This is why I detect what UITabBarItem was selected by user. NOTE: I cannot use selectedIndex because this way doesn't tell me what tab was chosen, since user IS ABLE to change the order of items in UITabBar . Within UITabBar there is property items and selectedItem but if there is more than 5 items, the property items keeps max 5 items. For

How can I remove the blue square that overlays UITabBarItem when selected?

谁都会走 提交于 2019-12-02 10:52:33
I have an iPad app (Xcode 5, iOS 7, ARC and Storyboards). I have a UITabBarController , and each scene has a UITabBarItem . When I tap a tab bar item, it goes to the correct scene, but the "current" tab bar item image is overlaid by a "blue box". How can I replace that "blue box" with a different image? (I don't want to change the color; I want to replace it with a different image). The images you use for a tab bar item have to have their renderingMode be, UIImageRenderingModeAlwaysOriginal or they will appear as blue squares (templates). The document called "Tab Bars", says this, Tab Bar Item

How to get the tag of selected UITabBarItem in UITabBarController for more than 5 items?

血红的双手。 提交于 2019-12-02 06:25:11
In Storyboard I created UITabBarController with 6 relationships to another view controllers. So now I have 6 UITabBarItems . I tagged them from 0 to 5 . This is why I detect what UITabBarItem was selected by user. NOTE: I cannot use selectedIndex because this way doesn't tell me what tab was chosen, since user IS ABLE to change the order of items in UITabBar . Within UITabBar there is property items and selectedItem but if there is more than 5 items, the property items keeps max 5 items. For instance when user choose UITabBarItem at index 4 OR 5 , selected Index is 4 for both of them. Now the

How to change UITabBarItem Badge position?

霸气de小男生 提交于 2019-12-01 21:27:26
This is how my Tabbar is looking right now. How do I move that badge so that it overlaps the top right of the bell icon? Any help is appreciated. try this: func repositionBadge(tabIndex: Int){ for badgeView in self.tabBarController!.tabBar.subviews[tabIndex].subviews { if NSStringFromClass(badgeView.classForCoder) == "_UIBadgeView" { badgeView.layer.transform = CATransform3DIdentity badgeView.layer.transform = CATransform3DMakeTranslation(-17.0, 1.0, 1.0) } } } pay attention, tabIndex starts from 1 Based on Marco Santarossa's answer , I updated it by making it into a UITabBarController

detect when a tabBar item is pressed via UITabBarController from App Delegate

旧城冷巷雨未停 提交于 2019-12-01 17:37:17
I know this question has been asked a few times, but I am still stuck on the case when I have my UITabBarController in my AppDelegate class and viewControllers are set there only as self.tabBarController.viewControllers = @[aboutUsNavController,myProfileNavController, projectsListNavController, feedsNavController,homeViewController]; Now what I want is to perform a task at the tap of TabBar item feedsNavController not in viewWillAppear (because it is pushing a detailView via navigationController ). I have set delegate in the same class to perform a UITabBarController delegate method: