在iOS 11之前的版本中使用TopLayoutGuide代替SafeAreaInset

时间:2019-02-16 12:14:05

标签: ios nslayoutconstraint swift4.2 safearealayoutguide

我试图将UILabel放置在navigationBar下面,并根据UILabel的高度将viewController的内容下推。

enter image description here

我正在为> iOS 11的设备使用其他SafeAreaInsets,在大多数情况下似乎都可以使用,但是iOS 11之前的后备版本似乎不起作用。内容被推送到标签(iOS 9)下:

enter image description here

该代码在containerViewController的viewDidLoad中调用。我正在将XCode 10.1和xib一起使用。

execFile

我希望内容在UILabel下方进行布局。我是否以错误的方式使用topLayoutGuide?它仅适用于在Interface Builder中设置的约束吗?

0 个答案:

没有答案