如何在 Swift 3 中将edgesForExtendedLayout 设置为none [英] How to set edgesForExtendedLayout to none in Swift 3
问题描述
问题是我的视图,在 ScrollView
中包含一个 UIView
和一个 UITableView
,隐藏在 UINavigationBar
如果设置为半透明.
The problem is that my View, containing a UIView
and a UITableView
within a ScrollView
, gets hidden under the UINavigationBar
if set translucent.
我考虑过几个类似this的话题,但它们都建议设置:
I have considered several threads like this, but they all suggest to set:
self.edgesForExtendedLayout = UIRectEdgeNone
在 Swift 2 中,这段代码是:
In Swift 2, this code was:
self.edgesForExtendedLayout = .None
我今天已更新到 Xcode 8.1 和 Swift 3.0.1,但在 发行说明 关于此事.
I have updated to Xcode 8.1 and Swift 3.0.1 today, but I can't find anything in the release notes about this matter.
编译器告诉我,.None
变成了.none
,但编辑后,那个.none
不存在.将其更改为 .top
没有任何效果.
The compiler tells me, that .None
got changed to .none
, but after edit, that .none
does not exist. Changing it to .top
did not had any effect.
tableView 是以编程方式设置的,放置 insets
没有帮助,因为我在 顶部有一个
.scrollView
和一个 UIView
隐藏在 UINavigationBar
下的 UITableView
The tableView is setup programatically and putting insets
does not help because I have a scrollView
with a UIView
on top of the UITableView
that is hidden under the UINavigationBar
.
我错过了什么?非常感谢帮助.
What am I missing? Help is very appreciated.
推荐答案
将其设置为 []
.这和没有一样.
Set it to []
. That is the same as none.
这篇关于如何在 Swift 3 中将edgesForExtendedLayout 设置为none的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!