uitabbar

Setting text-color on selected tab bar item

。_饼干妹妹 提交于 2019-11-28 23:45:42
I've created a tab bar application. I have four tabs; on the selected tab, I need to set the color red for tab title. How can i do that? Thanks in advance. If I understand your question correctly, you want to customize the color of the text on the UITabBarItem s. Unfortunately, it's really not that flexible. If you're intent on doing this (which, unless you've carefully considered the design with the help of a professional, I recommend against!), you'll have to do some really frightening things to get this to work. I'd suggest iterating through the subviews of the UITabBar (as many levels as

iPhone: How can I build my own TabBar?

前提是你 提交于 2019-11-28 19:58:19
Because I have some requirements for a tabbar that the normal iphone tabbar cannot provide, I am needing to build my own. What is the best way to build my own tabbar, specifically, how to add/remove (show/hide) views in my main view controller in the right way, taking into account memory and best practices for subviews? As I've stated elsewhere, it's almost never a good idea to get rid of the core navigational classes that are provided by UIKit . What type of application requirements do you have that you think merit a completely custom tab bar class? It's almost always possible to achieve the

How to change UITabBar Selection color

霸气de小男生 提交于 2019-11-28 18:37:21
I need to change the selection color of UITabBar from default blue to red. How do we do this. Update September 2017: It's been two years since I've written this answer and since it's receiving upvotes regularly, I should say this is probably the worst possible answer to this question, it's error prone, likely to break because of iOS updates, hard to debug, etc., so please don't do the things I've written and apply better solutions such as subclassing UITabBar or UITabBarController. Thanks. You can do this by setting a "tintColor" attribute (Key Path) for you UITabBar. Select the UITabBar in

how can i create custom tab bar …add custom images in tab bar (without xib changes)

女生的网名这么多〃 提交于 2019-11-28 18:30:06
i have one application in that tab bar is custom and also all image is different colors ... how can i create tabbar with diffrent colors and also with different images..this tabbar has navigation view. i got the answer .... h file code ... @interface CustomTabBarController : UITabBarController { } @end @interface AroundParisAppDelegate : NSObject <UIApplicationDelegate,UITabBarControllerDelegate> { UIImageView *imgTab ,*imghome ,*imgQuiz,*imgtTW, *imgGuest; IBOutlet CustomTabBarController *tabBarController; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain

What's the height of a UITabBar on iOS 8, iOS 9, iOS 10, and iOS 11?

折月煮酒 提交于 2019-11-28 18:23:45
问题 The height of the UITabBar seems to have changed between iOS 7 and 8/9/10/11. I'm posting this question for others to easily find the answer. So: What's the height of a UITabBar on iOS 8/9/10/11 on iPhone and iPad? 回答1: For iOS 8, 9, and 10 the height is 49 points , both on iPad and iPhone and both in portrait and landscape. It used to be 56 points on iOS 7. For iOS 11, things get a bit more complicated: In portrait and regular landscape , the height is still 49 points . In compact landscape

How to animate Tab bar tab switch with a CrossDissolve slide transition?

我的未来我决定 提交于 2019-11-28 17:19:46
I'm trying to create a transition effect on a UITabBarController somewhat similar to the Facebook app. I managed to get a "scrolling effect" working on tab switch, but I can't seem to figure out how to cross dissolve (or it doesn't work at least). Here's my current code: import UIKit class ScrollingTabBarControllerDelegate: NSObject, UITabBarControllerDelegate { func tabBarController(_ tabBarController: UITabBarController, animationControllerForTransitionFrom fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { return ScrollingTransitionAnimator

TableView Showing Behind Tab Bar

让人想犯罪 __ 提交于 2019-11-28 17:15:55
I am updating my app to use iOS 7 and I'm having a problem with a table view. My tab bar is translucent. The problem is when I scroll to the bottom of my table view, part of the last cell is still behind the tab bar. I'd like to have a bit of space between the last cell and the tab bar. I could fix this by using an opaque tab bar instead, but I want to keep it translucent. Try setting self.edgesForExtendedLayout = UIRectEdgeNone; self.extendedLayoutIncludesOpaqueBars = NO; self.automaticallyAdjustsScrollViewInsets = NO; Inside the tableview controller Swift 4.x let adjustForTabbarInsets:

iOS 7 TabBar Translucent issue

旧时模样 提交于 2019-11-28 17:05:48
I have an issue, when I set the translucent box off on a TabBar, there is something blocking some of my view. It looks like it's a sort of extra tab bar or I don't even know. I'm using storyboard. Please see the images attached: With Translucent (OFF - NO): With Translucent (ON or YES): Does anybody know why it looks like this? Thanks PS: Which tabBar do you guys like? Black or this one: nalyd88 This happens in iOS7 when you set tabBar.translucent to NO . iOS is trying to be smart and say "hey the tabbar is not translucent so we better push everything up on top of it". Fix it by setting the

Different colors for TabBar items in Tab Bar Controller

妖精的绣舞 提交于 2019-11-28 14:48:39
I have Tab Bar Controller with few tabs. All tab items should have same non-selected color for image and text. All tab items should have different selected color for image and text. I am ready to create images with colors needed for selected and non-selected items. And I know how to change this colors for all tabs from AppDelegate UITabBar.appearance().tintColor = UIColorFromRGB(rgbValue: MY_COLOR, aplhaValue: 1.0) UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColorFromRGB(rgbValue: MY_COLOR, aplhaValue: 1.0)], for: UIControlState.selected) UITabBarItem

Add a UIButton as a subview to a UITabBar

萝らか妹 提交于 2019-11-28 13:31:05
I am trying to implement a hideable UITabBar in my app. I've set up all the animations, and they work very well. I'm just having an issue getting my UIButton "pull-tab" to show the tab bar. It is not responding to the touch event UIControlEventTouchUpInside. I add the pull-tab to the UITabBar in the UITabBarController: - (void)viewDidLoad { [super viewDidLoad]; //Add pull pullButton = [UIButton buttonWithType:UIButtonTypeCustom]; UIImage *image = [UIImage imageNamed:@"TabBarPull.png"]; pullButton.frame = CGRectMake(self.tabBar.frame.size.width - image.size.width, -image.size.height + 3, image