我们在兼容ios8的时候,不能使用Safe Area,这样在xcode11 xib中使用UIScrollView会导致报错,因为xcode11要求UIScrollView必须使用contentLayoutGuide和frameLayoutGuide,这就会导致强制要求使用Safe Area,而无法兼容ios8。
报错如下:
Illegal Configuration
Content Layout Guide before iOS 9.0
Frame Layout Guide before iOS 9.0

解决办法
用xml打开xib,去掉UIScrollView标签里面的要求使用Safe Area的标签属性。
- 右键用Open As Source Code 打开 XIB文件。
- 找到ScrollView的标签中的 viewLayoutGuide标签和viewLayoutGuide标签,删掉即可。

网友评论