Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
359 views
in Technique[技术] by (71.8m points)

ios - How to set edgesForExtendedLayout to none in Swift 3

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

I have considered several threads like this, but they all suggest to set:

self.edgesForExtendedLayout = UIRectEdgeNone

In Swift 2, this code was:

self.edgesForExtendedLayout = .None

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.

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.

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.

question from:https://stackoverflow.com/questions/40315841/how-to-set-edgesforextendedlayout-to-none-in-swift-3

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Set it to []. That is the same as none.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...