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