【发布时间】:2016-07-26 19:47:01
【问题描述】:
我目前正在开发具有 4 个标签的标签栏应用程序。当我选择其中一个选项卡时,我想要类似于 Instagram 在单击“相机选项卡”时的行为,我通过添加如下代码实现了这一点。但是当我点击标签时;它首先显示黑屏,然后显示下面的视图。如何避免不显示黑屏?
override func tabBar(tabBar: UITabBar, didSelectItem item: UITabBarItem) {
if item.title == "More" {
let storyboard = UIStoryboard(name: "Main", bundle: nil);
let moreView = storyboard.instantiateViewControllerWithIdentifier("moreView") as! MoreView;
moreView.modalPresentationStyle = UIModalPresentationStyle.FullScreen;
self.presentViewController(moreView, animated: true, completion: nil)
}
}
【问题讨论】:
标签: ios objective-c swift uitabbarcontroller