我只是想知道我怎么能隐藏在Tab Bar Controller
标签项目为被选择隐藏标签
Q
隐藏标签
0
A
回答
1
首先当前视图控制器,我不认为这是可能隐藏UITabBarItem
- 它从UIBarItem
继承,但没有hidden
财产 - UIBarItem Documentation
你可以尝试比较标签栏selectedViewController
属性与目前的视图控制器? - 像下面的东西可能会工作..
if (self.tabBarController.selectedViewController == self) {
// Do Stuff
}
但即使如此,我认为你会发现很难隐藏标签栏项目本身。
+1
是的,阅读更多。我认为我的情况是最好的解决方案,一旦完成视图控制器就完全删除它。即登录屏幕。 –
0
UIView *parent = self.tabBarController.tabBar.superview; // UILayoutContainerView
UIView *content = [parent.subviews objectAtIndex:0]; // UITransitionView
UIView *window = parent.superview;
[UIView animateWithDuration:0.2
animations:^{
CGRect tabFrame = self.tabBarController.tabBar.frame;
tabFrame.origin.y = CGRectGetMaxY(window.bounds);
self.tabBarController.tabBar.frame = tabFrame;
content.frame = window.bounds;
}];
3
从控制器删除预期的索引数组ex。 (1)
NSMutableArray *controllersArray = [NSMutableArray arrayWithArray:self.tabBar.viewControllers];
[controllersArray removeObjectAtIndex: 1];
[self.tabBar setViewControllers:controllers animated:YES];
检查这个答案我也发现这个类似从你的问题Hide tab bar item and aligning other tab items 希望这有助于你。!
相关问题
- 1. 隐藏标签
- 2. 隐藏标签
- 3. 隐藏标签页
- 4. 隐藏轴标签
- 5. 隐藏在标签
- 6. 隐藏取消隐藏div标签
- 7. 隐藏轴标签SSRS图
- 8. Tablayout中隐藏标签Android
- 9. 禁用,不隐藏标签
- 10. 隐藏标签从引导
- 11. Winform menustrip和隐藏标签
- 12. Chrome渲染隐藏标签
- 13. 如何隐藏空标签
- 14. 如何隐藏标签?
- 15. 显示/隐藏标签
- 16. 隐藏货运标签woocommerce
- 17. 无法隐藏标签; JQuery
- 18. jQuery和隐藏标签
- 19. Dygraph.js中的隐藏标签
- 20. 隐藏UI角标签
- 21. 如何隐藏HTML标签?
- 22. 标签导航栏隐藏
- 23. 显示和隐藏标签
- 24. CanvasJS图表隐藏标签?
- 25. 隐藏/显示div标签
- 26. angularjs显示/隐藏标签
- 27. 隐藏标题标签上悬停
- 28. 根据标题隐藏标签
- 29. Ionic 2 Tabs:隐藏标签图标
- 30. 隐藏我的图标标签
如何在隐藏在当前视图中时选择其他选项卡? –
你在Swift或ObjC工作吗? – Wez
@Wezly在ObjC工作 –