3

I have an old app that is having strange layout behavior because of iOS7. It is not a storyboard app.

I started a storyboard app and came across 'Extend Edges' in the inspector, which seems to solve the issue on that particular app, however I don't have those options in my old app.

Is there a way for me to programmatically set those options?

4

2 回答 2

5

Figured it out:

self.edgesForExtendedLayout = UIRectEdgeNone;
于 2013-10-14T14:51:23.830 回答
4

在较新的 swift 版本中,扩展布局的使用略有改变。

In SWIFT 2
self.edgesForExtendedLayout = UIRectEdge.None

In SWIFT 3
self.edgesForExtendedLayout = []
于 2016-11-03T11:22:21.403 回答