iOS导航栏偏移20像素问题处理
2017-11-10 本文已影响78人
flionel

问题描述
开发过程中遇到一个问题,push到新页面之后,导航栏向下偏移了20像素,遮盖了view的内容,网上搜索了解决方案,如下所示,
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.navigationBar.isTranslucent = true
edgesForExtendedLayout = []
automaticallyAdjustsScrollViewInsets = false
extendedLayoutIncludesOpaqueBars = false
}