我們在兼容ios8的時候,不能使用Safe Area,這樣在xcode11 xib中使用UIScrollView會導(dǎo)致報錯,因為xcode11要求UIScrollView必須使用contentLayoutGuide和frameLayoutGuide,這就會導(dǎo)致強(qiáng)制要求使用Safe Area,而無法兼容ios8。
報錯如下:
Illegal Configuration
Content Layout Guide before iOS 9.0
Frame Layout Guide before iOS 9.0

kkk.png
解決辦法
用xml打開xib,去掉UIScrollView標(biāo)簽里面的要求使用Safe Area的標(biāo)簽屬性。
- 右鍵用Open As Source Code 打開 XIB文件。
- 找到ScrollView的標(biāo)簽中的 viewLayoutGuide標(biāo)簽和viewLayoutGuide標(biāo)簽,刪掉即可。

aaaa.png