导航栏没有隐藏

时间:2015-08-18 02:09:38

标签: ios swift storyboard

出于某种原因,我的底部导航栏没有隐藏在我的主视图控制器上(以下故事板中的蓝屏):

Main Storyboard

我不希望在蓝屏底部显示标签栏,所以我在其视图控制器中输入以下代码:

override func viewWillAppear(animated: Bool) {
    self.navigationController?.setToolbarHidden(true, animated: animated)
    self.navigationController?.setNavigationBarHidden(true, animated: animated)
    super.viewWillAppear(animated)
}

override func viewWillDisappear(animated: Bool) {
    self.navigationController?.setToolbarHidden(false, animated: animated)
    self.navigationController?.setNavigationBarHidden(false, animated: animated)
    super.viewWillDisappear(animated)
}

顶部导航栏未显示(如预期),但底部栏未隐藏。此后它也会在每个屏幕上显示两次(见下面的截图):

App Screen

是不是因为我的界面构建器中有一个标签栏控制器?有没有办法以编程方式实现带有四个图标的标签栏控制器?我真正想要标签栏控制器的唯一屏幕是Table View。

2 个答案:

答案 0 :(得分:0)

使用<script type="text/javascript" src="swfobject.js"></script> <div id="flashPlayer"> This text will be replaced by the flash music player. </div> <script type="text/javascript"> var so = new SWFObject("playerMultipleList.swf", "mymovie", "295", "200", "7", "#FFFFFF"); so.addVariable("autoPlay","yes") so.addVariable("repeat","false") so.addVariable("playlistPath","playlist.xml") so.write("flashPlayer"); </script>`

在具有蓝色背景颜色的视图控制器中:

package main

import "fmt"

func main() {
    fmt.Println("Hello world")
}

答案 1 :(得分:0)

删除此行self.navigationController?.setToolbarHidden(true, animated: animated)TextField的顶部连接(安全区域)更改Superview