[英]iOS tab bar issue
In my app i'v UITabbarController
as rootviewController with 3 tabs on it, each tab has its own UINavigationController
.On the first tab i'v attached a UIViewController
that hides tab bar and navigation bar, by click on a button user can go to next screen that will show tab bar as well as navigation bar.Now the problem is when i click on first tab on this view controller (which is already selected by default) it takes me on previous view controller and i want it should stay on the same screen.How to achieve this? 在我的应用程序中,我将
UITabbarController
作为rootviewController并带有3个选项卡,每个选项卡都有其自己的UINavigationController
。在第一个选项卡上,我附加了一个UIViewController
,该选项卡隐藏了选项卡栏和导航栏,通过单击按钮用户可以转到下一个屏幕将显示选项卡栏和导航栏。现在的问题是,当我单击此视图控制器上的第一个选项卡(默认情况下已选择)时,它将带我使用以前的视图控制器,并且我希望它保持相同屏幕。如何实现?
Edit : I dont want to disable bar item at index 0 as this turns it into UIControlStateDisabled
which make it different looks from others. 编辑 :我不想禁用索引0的栏项目,因为这会将其变成
UIControlStateDisabled
,这使其外观与其他外观有所不同。
Is there any way to set image for UIControlStateDisabled
for tab bar item? 有什么方法可以为选项卡栏项的
UIControlStateDisabled
设置图像吗? Any help or suggestion would be appreciated. 任何帮助或建议,将不胜感激。
Try this may be helpfull... 试试这个可能会有所帮助...
[[[[self.tabBarController tabBar]items]objectAtIndex:1]setEnabled:FALSE];
set "objectAtIndex" that you want.. 设置所需的“ objectAtIndex”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.