How to set edgesForExtendedLayout to none in Swift 3

前端 未结 4 1905
终归单人心
终归单人心 2020-12-30 18:44

The problem is that my View, containing a UIView and a UITableView within a ScrollView, gets hidden under the UINavigationBar

相关标签:
4条回答
  • 2020-12-30 19:28
    self.edgesForExtendedLayout = UIRectEdge.init(rawValue: 0)
    
    0 讨论(0)
  • Set it to []. That is the same as none.

    0 讨论(0)
  • 2020-12-30 19:36

    SWIFT 5 solution

    override func viewWillAppear(_ animated: Bool) {
       super.viewWillAppear(animated)
    
       self.edgesForExtendedLayout = []
    }
    
    0 讨论(0)
  • 2020-12-30 19:43

    I don't know how but I just add following code in my viewDidLoad() self.navigationController?.navigationBar.isTranslucent = false And it solves my problem.

    0 讨论(0)
提交回复
热议问题