Swift-解決Navigation導航欄遮擋住view內容的問題

Swift-解決NavigationBar遮擋住view內容的問題php

edgesForExtendedLayouthtml

The extended edges to use for the layout.ide

automaticallyAdjustsScrollViewInsets.net

A Boolean value that indicates whether the view controller should automatically adjust its scroll view insets.code

extendedLayoutIncludesOpaqueBars
A Boolean value indicating whether or not the extended layout includes opaque bars.htm

代碼示例:blog

override func viewDidLoad() {
    super.viewDidLoad()

    // Do any additional setup after loading the view.
    //解決 NavigationBar 擋住 view 內容的問題
    //將edgesForExtendedLayout設置成UIRectEdgeNone,代表View是不要擴展到整個屏幕的
    self.edgesForExtendedLayout = UIRectEdge.None

    //打印查看:automaticallyAdjustsScrollViewInsets默認爲true
    //print(self.automaticallyAdjustsScrollViewInsets.boolValue)
    //self.automaticallyAdjustsScrollViewInsets

    ... ...
}

參考:get

http://www.cocoachina.com/bbs/read.php?tid=153502
http://www.cocoachina.com/bbs/read.php?tid-195157-page-e-fpage-705.html
http://my.oschina.net/u/2407613/blog/509280it

相關文章
相關標籤/搜索