uitabbar

How to create translucent (with content behind it) UITabBar

狂风中的少年 提交于 2019-12-05 21:33:04
I have subclassed UITabBar and overriden drawRect: method to make it transparent (and make it look like I need to). Problem I am having is that the view added to UITabBarController does not cover whole screen but ends 49 pixels above bottom, so even tho I have transparent tabbar, I can't see thing behind it. Is there proper way how I can set size of UIView inside UITabBarController to cover entire screen? P.S.:I know it is not good idea to show content behind tabbar. I do not want to show any content there, just art, that is specific to each View and needs to be visible through tabbar. If you

change tabbar text color,iPhone

瘦欲@ 提交于 2019-12-05 15:08:25
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 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 yellowColor], UITextAttributeTextColor, [UIColor redColor], UITextAttributeTextShadowColor, [NSValue

Is there a way to adjust the width of UITabBar button items to fit more than 5 buttons on the screen?

吃可爱长大的小学妹 提交于 2019-12-05 13:25:20
My buttons seem stretched, especially in landscape orientation. I can't find a property to adjust either on the UITabBar, UITabBarViewController, or on the UITabBarItem's themselves. (Of course, one answer would be to get an iPad...but that doesn't solve the need for a phone.) For example, consider this simple Tab Bar Example - if I only could set the tab bar to auto-shrink as more buttons are added, or manually adjust the width to fit them all on the tab bar, I would be happy. It is not possible to use the UITabbar with more than five visible buttons. You've got to write your own component.

What's the best way of adding a custom centre button to a tab bar?

丶灬走出姿态 提交于 2019-12-05 12:11:56
Many apps have a standard tab bar with a custom button in the centre which performs some special function. Some examples can be found here: http://mobile-patterns.com/custom-tab-navigation What's the best way of implementing this? Here you can see how to implement that button. I am gonna paste the code so it stays here forever: UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0.0, 0.0, buttonImage.size.width, buttonImage.size.height); [button setBackgroundImage:buttonImage forState:UIControlStateNormal]; [button setBackgroundImage:highlightImage

Tab bar not showing icons?

一笑奈何 提交于 2019-12-05 11:26:29
问题 I read a bunch of related questions, I tried what they said, nothing works really. Not sure why. So, I have 3 different UIStoryboards . First one is the Auth Storyboard that handles Login/Register and there's a storyboard reference to the second Storyboard - Tab bar storyboard. This storyboard contains 5 other storyboard references that would load it's separate view controllers. My problem is that the icons are not showing once the user is logged in. I setup a custom color of the first view

why does selecting a tabbarController index programatically doesnt call delegate method

懵懂的女人 提交于 2019-12-05 09:40:58
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 setSelectedViewController:[self.tabBarController.viewControllers objectAtIndex:0]]; the delegate methods are not called.

Programmatically change tabBar item?

浪尽此生 提交于 2019-12-05 08:14:48
I would like to change a TabBar Item , when a User is logged in or not. For example: i have 5 different tabBar items, all created an Storyboard. Now i want to change the tarBar with index 2 (or tag == 2) when i user has no account. I would like to load a different rootViewController. The rootViewController is not already an item of my TabBar, i would load a totally different Controller. What is the best way to do this? I can simple change the icon with: self.tabBar.items![0].selectedImage = UIImage(named: "icon_cal_grey") But how to i change the rootViewController? Should i do it here?

iPhone:Color of TabBar image?

ⅰ亾dé卋堺 提交于 2019-12-05 07:46:44
问题 I have added an image(Orange color) to TabBar, but when I run application image shown gray ! How can I slove this problem ? thanks 回答1: The color is fixed to blue. You could either try to write your own custom tab bar interface, or hack together something to place custom icons over the tab bar in a subclassed UITabBarController , like this: -(void)setActiveCustomOverlay { if ( self.activeOverlay ) { [self.activeOverlay removeFromSuperview]; } NSString *imagename = [NSString stringWithFormat:@

How to refresh a tableView on click tabBar item Swift?

流过昼夜 提交于 2019-12-05 07:27:55
问题 I have a tableView into a viewController on tab Bar. When I click into tabBar item the tableView isn't refreshing. But I have the viewWillAppear function: override func viewWillAppear(animated: Bool) { dispatch_async(dispatch_get_main_queue(), { () -> Void in self.tableView.reloadData() }) } I'm trying call this function with tab bar delegate, but not works: func tabBar(tabBar: UITabBar, didSelectItem item: UITabBarItem) { dispatch_async(dispatch_get_main_queue(), { () -> Void in self

Change UITabBar selectedItem in Swift

会有一股神秘感。 提交于 2019-12-05 05:12:41
How can I programmatically change the selected item in a UITabBar? Swift 3 and later As of Swift 3, you can also use tabBarController.selectedIndex = 0 // (or any other existing index) (Thank you, @nidomiro.) Swift 2.2 and earlier Try the following tabBar.selectedItem = tabBar.items![newIndex] as! UITabBarItem Assuming you have access to the UITabBarController that owns the UITabBar , you can do the following self.selectedViewController = self.viewControllers![newIndex] as! UIViewController The above line of code should be put somewhere inside of the UITabBarController subclass. But if you