bottom layout deprecated since ios 11.0

2019-03-27 14:25发布

What can I do to fix Bottom layout is deprecated iOS 11, I am using Xcode 9 beta 2.

enter image description here

3条回答
虎瘦雄心在
2楼-- · 2019-03-27 14:48

Simply check the "Use safe area layout guides" button in the File Inspector of the IB.

use safe area layout guides

查看更多
贼婆χ
3楼-- · 2019-03-27 14:53

Function of @paper1111 works fine in Xcode Version 9.3.1, but for me not worked first time. After two days of World War with Interface Builder

Solution:

1) check the "Use safe area layout guides" button in the File Inspector of the Interface Builder.

2) uncheck the "Use safe area layout guides" button in the File Inspector of the Interface Builder.

3) check again the "Use safe area layout guides" button in the File Inspector of the Interface Builder.

查看更多
迷人小祖宗
4楼-- · 2019-03-27 14:57

According to this, in iOS 11, IB replaces bottomLayoutGuide by safeAreaLayoutGuide.

Interface Builder uses UIView.safeAreaLayoutGuide as a replacement for the deprecated Top and Bottom layout guides in UIViewController. To use the new safe area, select Safe Area Layout Guides in the File inspector for the view controller, and then add constraints between your content and the new safe area anchors. This prevents your content from being obscured by top and bottom bars, and by the overscan region on tvOS. Constraints to the safe area are converted to Top and Bottom when deploying to earlier versions of iOS. (29323293)

查看更多
登录 后发表回答