Main.storyboard常见警告

使用Main.Storyboard会遇见许多警告,说一下如何解决问题。

1 Plain Style unsupported in a Navigation Item。

Main.storyboard常见警告_第1张图片 导航栏的按钮不支持plain 样式的。

解决方法:修改plain样式为Done、Bordered。需要修改所有的导航栏上的按钮bar butoon itme。


2 Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier:.

Main.storyboard常见警告_第2张图片 为了在程序中动态访问Scene,需要给其设置一个Storyboard ID。

解决办法:给Storyboard中的所有 ViewController设置一个Storyboard ID,需要都设置才能去掉这个警告。


3  Value other than autosizing specified for width (System items, other than fixed spaces, should use autosizing)

在界面底部放了一个toolbar,Main.storyboard常见警告_第3张图片

效果如图所示 

其中的子控件宽度更改后出现这个问题。

解决方法:使用自动调整大小,不要设置其宽度,也就是设置成0即可。如图所示:



4 Vertical position is ambiguous for "scan_bind.png".

垂直位置不确定。

解决方法:添加竖直约束,例如“


Horizontal position is ambiguous for "iconView".

水平位置 不确定

添加水平位置 约束条件即可,如图所示:

  iconView.centerX = centerX.


5 Height and horizontal position are ambiguous for "Table View Setting".

高度和水平位置不确定。

Main.storyboard常见警告_第4张图片缺少高度和水平开始位置。

解决办法:添加高度和水平位置 约束。

Main.storyboard常见警告_第5张图片


6 Frame for "Unbond Btn" will be dirrerent at run time .

Main.storyboard常见警告_第6张图片 位置在运行时将会不一样。storboard上的位置和运行时将会不一样。

解决办法

水平位置有问题,只需要将这个按钮右移到30就可以了。

 约束该按钮宽度为540,但画布上(storyboard)宽度为550。只要将宽度拉一下变成540就可以了。

 

你可能感兴趣的:(ios,异常,布局,Main.storyboard)