uitabbarcontroller

Get selected index tabbar controller Swift

我的未来我决定 提交于 2019-12-06 02:33:23
I'm trying to get the selected index of the tabbarController. let application = UIApplication.sharedApplication().delegate as AppDelegate let tabbarController = application.tabBarController as UITabBarController let selectedIndex = tabBarController.selectedIndex I'm getting this error: 'UITabBarController?' does not have a member named 'selectedIndex' Am I missing something? application.tabBarController is an optional, this means it can be nil . If you are sure it will never be nil , do this: var selectedIndex = tabBarController!.selectedIndex you should try this: let application =

UITabBarController - how to make “no tabs” selected at start up?

故事扮演 提交于 2019-12-06 02:33:13
Is there any way in iPhone to unselect all tabs of a UITabBarController ? ie, my application has a "homepage" which does not belong to any tabs on the below displayed tabbar. Now when user touches any tab on the tabbar, I would like to load the corresponding tab. Is this possible ? I have already tried: self.tabBarController.tabBarItem.enabled = NO; self.tabBarController.selectedIndex = -1; but this does not help. Any other solutions ? Please ? I've managed to accomplish this using KVO tricks. The idea is simple: we track down when UITabBarController tries to set its selectedViewController

Tab bar item tint color

旧街凉风 提交于 2019-12-06 02:25:53
问题 In iOS 7, I been developing an app that uses the UITabBarController and I noticed that the tab bar items stay gray even tho I change the tint color of the tab bar. Is there any way to change the color of non-selected tab bar items? 回答1: To do this:: follow a simple approach.. Change tintColor as you want Add a new set of images for unselected items and render them in original mode. For more info, read through this link 回答2: To sets the tint color globally for the app, you need to add below

Objective C: How to reload tableview immediately after switching tabs?

亡梦爱人 提交于 2019-12-06 02:22:06
问题 I have 2 tabbars in my tabbar controller. I am currently in the second tabbar, after I click on a 'done' button, the tabbar controller needs to switch to the first tab and auto refresh the tableview in it. I am able to execute on the first part //Switch to the first tab's view self.tabBarController.selectedViewController = [self.tabBarController.viewControllers objectAtIndex:0]; However I need some advise on how to refresh the first view's tableview immediately after the switch is made. Any

Keeping tab bar on View after segue?

妖精的绣舞 提交于 2019-12-06 02:13:56
问题 I have a tab bar controller, then a navigation controller, then a first view controller. This view controller has a tab bar as expected. However, when I segue from this view I lose the tab bar. I want it to retain its position on the other VC's stemming from this first view. Here is my IB: I want the tab bar to also appear on the left VC after it is loaded via segue from the right VC, How is this achieved as currently it disappears regardless of me setting the tab section at the bottom of the

Disable tab bar navigating to root view

為{幸葍}努か 提交于 2019-12-06 01:56:46
问题 I have a tab bar based application with navigation on each tab bar item. When i navigate to another view on any tab bar item and click on on tab bar item,then root view controller on that tab bar item is called. Its like PopToRootView . Can we disable this situation? 回答1: Yes, you can disable the automatic popToRootViewController by implementing the UITabBarControllerDelegate method on your view controller: - (BOOL)tabBarController:(UITabBarController *)tabBarController

why changing of tab, stopping the animation in ios app?

萝らか妹 提交于 2019-12-06 01:50:15
问题 i have multiple tabs in my app. i one view controller there is animation running, when i switch to another view controller, and again comes to view controller with animation, then animation stops, can anybody guide me to work my Xcode even switching of tab in Iphone app? - (IBAction)btn:(id)sender { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString *soundStatus = [defaults objectForKey:@"Sound_Swich"]; //NSLog(@"soundstatus is %@ ", soundStatus); if([soundStatus

iOS 10: Custom UITabBar background image produces border at top of image. How do I remove it?

廉价感情. 提交于 2019-12-06 01:26:27
问题 Anyone have a working solution to get rid of this border in iOS 10? I have a custom UITabBar background image. I've tried the following with no results: tabBar.backgroundImage = UIImage(named: "myBackgroundImage.png") tabBar.shadowImage = nil tabBar.shadowImage = UIImage() // i've also tried combinations of this in the storyboard directly I finally threw my hands up in the air and set the bar style to "Black".. this doesn't get rid of the border, but makes it white. So it hides it. 回答1: If

你所不知道的UITabBarButton?

三世轮回 提交于 2019-12-06 01:24:25
项目源码请查看我的GitHub项目地址: https://github.com/DXSmile/-Usage-of-UITabBarButton-.git ##阐述: 只要有一定开发经验的iOS攻城狮,只要你做过应用程序APP的开发,不可避免的都会用到UITabBarController, UITabBarController又称标签控制器 ,同样是管理多控制器的,我们一般的做法都是将多个(一般是4-6个之间)UINavigationController作为UITabBarController的子控件,添加到UITabBarController的导航标签栏(也叫工具条)UITabBar上; 今天在这里,我要讲的,不是怎样创建一个UITabBarController,因为,这个比较简单,也是每个iOS攻城狮所需要必备的技能,那么问题来了,今天,我要说什么呢 ? 细心的朋友估计已经看出来了, 没错, 我要讲的是, 在创建UITabBarController的UITabBar标签栏的时候, 容易困扰也容易被大家忽视的UITabBarButton的问题. 1.什么是UITabBarButton? &1. 我们都知道UITabBarController下方的工具条称为UITabBar ,如果UITabBarController有N个子控制器,那么UITabBar内部就会有N

Swift UITabBarController hide with animation

独自空忆成欢 提交于 2019-12-06 01:15:21
I'm trying to add animation to my tabBarController when hidden. Im able to accomplish this effect with the navigationBarController by using self.navigationController?.isNavigationBarHidden = true . I'm able to hide the tabBar by using self.tabBarController?.tabBar.isHidden = true but i do not get the animation how can I do this thank you in advance. You could change the tab bar's frame inside an animation, so something like: func hideTabBar() { var frame = self.tabBarController?.tabBar.frame frame?.origin.y = self.view.frame.size.height + (frame?.size.height)! UIView.animate(withDuration: 0.5,