uitabbar

Tab bar background is missing on iOS 7.1 after presenting and dismissing a view controller

会有一股神秘感。 提交于 2019-11-28 06:53:22
I've tried my app on iOS 7.1 and I found that the tab bar background disappears on a few occasions. I was able to track them down; it happens when: pushing a view controller placed inside navigation controller (that is inside tab bar controller) with hidesBottomBarWhenPushed = YES presenting a view controller and then dismissing it (i.e. the MFMailComposeViewController ) I've created a sample app (used the tab bar template + added button to display the view controller, and a mapView to be able to tell if the bar disappeared), and the issue is there. Here is all the code for the sample app that

hidesBottomBarWhenPushed = NO not working?

雨燕双飞 提交于 2019-11-28 06:49:57
I have a UITabBar in my app, which I'm hiding on the first UIViewController in the first tab by putting this line in the A ppDelegate : // ... in MyAppDelegate.m firstViewController.hidesBottomBarWhenPushed = YES; In the firstViewController , the user can push a UIButton that pushes a new UIViewController in the same tab. I'd like for the UITabBar to be visible again when this happens. I'm trying to make it come back like this: //... in firstViewController.m secondViewController = [[SecondViewController alloc] init]; secondViewController.hidesBottomBarWhenPushed = NO; [[self

Is there a way to use a custom selected image for UITabBarItem?

蓝咒 提交于 2019-11-28 05:08:42
I like to have a custom selected image when a user selects an item on the tab bar, by default it selects as blue like but would like to have a green color instead. something like below any thoughts? Just found my solution. Basically, I subclassed UITabItem and set this in the navigation controller: -(void) viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; CustomTabBarItem *tabItem = [[CustomTabBarItem alloc] initWithTitle:@"Events" image:[UIImage imageNamed:@"tabIcon.png"] tag:0]; tabItem.customHighlightedImage=[UIImage imageNamed:@"tabIconSelected.png"]; self.tabBarItem = tabItem

Set background color of active tab bar item in Swift

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 04:24:27
I'm hoping to accomplish this without the use of images, if at all possible. Is there a way to create the effect shown in the image programmatically without have to render each tab out as an image? Every question I've reviewed on SO has the tabs saved as JPGs, which is more work than I feel it should be. Any ideas? schickling I took a similar approach to @matcartmill but without the need for a special image. This solution is just based on your color. // set red as selected background color let numberOfItems = CGFloat(tabBar.items!.count) let tabBarItemSize = CGSize(width: tabBar.frame.width /

Swift - How to change UITabBarItem badge font?

百般思念 提交于 2019-11-28 03:53:29
问题 I have a UITabBar . I set a value for tab bar items: tabBarItem3?.badgeValue = String(self.numberOfProducts) Now I want to change its font to a specific font. Then I used this code : tabBarItem3?.setBadgeTextAttributes([NSFontAttributeName: UIFont(name: "IRANSans", size: 14)], for: .normal) It doesn't work. What should I do? 回答1: Swift 3 UITabBarItem.appearance().setBadgeTextAttributes([NSFontAttributeName: UIFont(name: "IRANSans", size: 14)], for: .normal) UITabBarItem.appearance()

Custom tab bar background image - in iOS 4.x

一世执手 提交于 2019-11-28 03:51:41
问题 I have made a tab bar iOS project, when I received the request to change the tab bar's background image to a custom image. The project is developed for iOS 4.x, so the iOS5's [tabBar setTabBarBackgroundImage:[UIImage imageNamed:@"custom.jpg"]] does not work. Can you suggest me some simple solutions (if there is any possibility, I would not like to change the entire project)? Edit: Only three lines of code can resolve all: UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage

Unselected UITabBar color?

不想你离开。 提交于 2019-11-28 03:19:12
I have an UITabBar with 5 items. I want to change the unselected color of all items. The items aren't declared in the UIViewController classes (i built them and linked the views in the Storyboard). Is there an code like this : [[UITabBar appearance] set***UN***SelectedImageTintColor:[UIColor whiteColor]]; ? SO says i cannot delete the accepted answer (i tried), but obviously, there are a lot of upvotes for comments that this doesn't work for iOS 7. See the other answer below with many more upvotes, or the link in @Liam's comment to this answer. for iOS 6 only It should be as simple as this: [

maximum number of tabs for UITabBarController without moreViewController

早过忘川 提交于 2019-11-28 02:45:13
问题 Short of actually creating a UITabBarController and performing the relevant experiment, does iOS have a programmatic way of getting the maximum number of tabs that could show up in the tabBarController, without a "more" tab? This would be highly helpful for some cross-platform work I'm doing. 回答1: The most is 5 (on an iPhone, 8 on an iPad). When you add a sixth you get the 1st four plus a More tab with the other two. This can't be changed using a standard UITabBarController . Search github or

Tabbar in Second View

点点圈 提交于 2019-11-28 02:28:13
I have an activation page in my app, which is mandatory for every user to activate the app. Once the app is activated, the user moves to the tabbed bar view. I have created a tabbed bar application, where from my activationView on click of button I am trying to call the tab bar, I am getting an entire black screen. - (IBAction)moveToActivateView:(id)sender { AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; UITabBarController *tabBarController = [[UITabBarController alloc]init]; [self.view addSubview:tabBarController.view]; appDelegate.window = [[UIWindow

An unwanted line on Tab bar controller under ios7

爷,独闯天下 提交于 2019-11-28 01:47:07
问题 Under iOs7, and not earlier versions, I've a line who pass through my Tab Bar (shown with green arrow on example picture from the link below). I don't know where the problem come from. Any idea how to correct it ? Thank you very much. 回答1: I think you have to check the height of UITabBar in iOS 7. It is possible Apple has decreased the height of UITabBar, as per height of UITabBar you have to redesign your image for accurate result. 回答2: If you're referring to the couple of pixel shadow on