uitabbar

how to programmatically change the tabbarItem's image

心不动则不痛 提交于 2019-12-23 12:26:14
问题 I'm developing a shopping cart tab. Originally I just use the default badge value to show how many items in the cart on the bottom tabbar. Now the designer wants to be fancy, he wants to show different image based on how many items in the cart. For example, if there's one, show cartTab-1.png, if 2, show cartTab-2.png... I tried to change the tabaritem ( UITabBarItem )'s image but it didn't work for me. Is it feasible? I discussed with my colleague, he said I may have to draw the image on top

adding a layer mask to UIToolBar/UINavigationBar/UITabBar breaks translucency

一个人想着一个人 提交于 2019-12-23 09:42:03
问题 Im upgrading my UI to iOS 7, and have been using a custom tab bar which has a CAShapeLayer used as a mask. Ive been trying to add dynamic blur by having a UIToolBar underneath, but if i try setting the layer.mask property on the toolbar translucency is gone, and i just have it semi transparent (but masking works of course). Is there a way to get this working? Ive also seen this behavior when adding a subview to these classes. 回答1: If "translucency is gone" means it becomes totally transparent

UITabBar subviews change order

吃可爱长大的小学妹 提交于 2019-12-23 02:07:22
问题 I'm iterating over UITabBar views like so: for (UIView *view in [tabBar subviews]) { if ([view isKindOfClass:[UIControl class]]) { tabBarItemFrame = [tabBar convertRect:view.frame toView:self.view]; } } The order is initially: <_UITabBarBackgroundView: 0x7a62e150; frame = (0 0; 768 49); autoresize = W; userInteractionEnabled = NO; layer = <CALayer: 0x7a62fcd0>>, <GSBadgeView: 0x7b1b6060; frame = (0 0; 0 0); hidden = YES; layer = <CALayer: 0x7b1b61d0>>, <UITabBarButton: 0x7d75ee80; frame = (71

sharing NSManagedObjectContext and other service classes between iphone/ipad tabs

旧巷老猫 提交于 2019-12-22 18:19:43
问题 I am well into building a Core Data tab-based iPad application. I am passing in my NSManagedObjectContext to my root view using the following in my app delegate class. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.rootViewController.managedObjectContext = self.managedObjectContext; [window addSubview:tabBarController.view]; [window makeKeyAndVisible]; return YES; } My question is: how do I set the same managedObjectContext

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

寵の児 提交于 2019-12-22 12:49:00
问题 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. 回答1: 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

How to show a UIDatePicker over the tab bar, in an orientation-friendly way?

℡╲_俬逩灬. 提交于 2019-12-22 09:49:03
问题 I want to slide in a UIDatePicker when my user taps on my table view date field, exactly as in the standard contact app, when the user taps on the birthday field. With one additional killer detail: It's in a tab bar application and I want the UIDatePicker to slide over the tab bar. And still rotates when the user puts her phone in the lanscape orientation. The way I show the UIDatePicker is to insert in the view, and then animate its position: [self.view addSubview: self.pickerView]; When I

Hide TabBar in iOS 6

 ̄綄美尐妖づ 提交于 2019-12-22 09:46:49
问题 I want to Hide my TabBar in iOS 6 , when i wrote the code which is given below it works in iOS 7 but it shows black line in iOS 6 self.tabBarController.tabBar.hidden = YES; Here is snapshot for iOS 6 : 回答1: Try with below code May be this will help you... - (void)hideTabBar:(UITabBarController *) tabbarcontroller { for(UIView *view in tabbarcontroller.view.subviews) { if([view isKindOfClass:[UITabBar class]]) { if([UIScreen mainScreen].bounds.size.height==568) { [view setFrame:CGRectMake(view

change tabbar text color,iPhone

老子叫甜甜 提交于 2019-12-22 08:50:12
问题 I have created a tabbar programmatically. Can we change color of title of the tabbar item? Default is white, and i m trying to make it black. something like tabbaritem.text.textcolor=[UIcolor Blackcolor]; Thanks 回答1: In iOS5 you use the appearance proxy to change the title color: For a specific tabbar item: [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIFont fontWithName:@"AmericanTypewriter" size:20.0f], UITextAttributeFont, [UIColor

why does selecting a tabbarController index programatically doesnt call delegate method

回眸只為那壹抹淺笑 提交于 2019-12-22 06:36:01
问题 when we touch the tabbaritem of the tabbarcontroller the delegate methods are called: -(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController; - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController; but when try to do the same thing programmatically, i.e. [self.tabbarController setSelectedIndex:selectedIndexNo]; or [self.tabBarController

Set UITabBarItem title programmatically?

拈花ヽ惹草 提交于 2019-12-22 05:23:17
问题 My app is based on a tab bar architecture. In order to have an easy internationalisation mechanic, I do not write any string in XIB files. viewdidload permits to change programmaticaly the strings in the views. When my app launches, I can see the 4 tabs. But in fact only the first one loads its view controller. The others wait for user click to be loaded. Tabs title can be changed using [self setTitle:@"Mouhahaha"]; in viewDidLoad of loaded view controller. If I want to keep my