ios - UITabBarController Tab Modal Presentation -Swift2 OS

标签 ios swift2 uitabbarcontroller presentmodalviewcontroller

我有一个 tabBarController,有 2 个选项卡:tab1 和 tab2。我在 tab1 中有一个名为 pressButton 的按钮。当按下时,它会自动切换到 tab2。如何在切换选项卡时以模态方式呈现 tab2?

问题是我想在模式演示后保持两个选项卡在底部可见。文档说模态演示将完全占据整个屏幕。我不希望模式隐藏底部 tabBarController 选项卡。我该怎么做?

@IBOutlet func pressButton(sender: UIButton){
   self.tabBarController!.selectedIndex = 1
}

最佳答案

要自定义标签栏,请使用以下链接

Customization of Tabbar using button

在按钮 Action 中,使用模态动画显示标签栏。

快乐编码...

关于ios - UITabBarController Tab Modal Presentation -Swift2 OS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39730762/

相关文章:

ios - 如果 App delegate 想要使用主 Storyboard文件,它必须实现 window 属性

ios - 在 ios7 上,Spotify Login with Facebook View shown below Navigation Item

ios - 如何在UIpickerView的特定行中插入图像和文本?

iphone - 如何将服务器连接到 Xmmp 服务器

ios - 拖动时更新 MKPointAnnotation 对象

ios - swift 2.0 : Initialize a CBCharacteristic?

UITabbarController 以编程方式更改栏项标题

ios - Controller 中的重复代码

ios - Storyboard Global Tint UITabBar Tint 在 IOS 7.1 中发生了变化

swift - 访问 UITabBarController 中的内容