ios - storyboard中设置layout, 能不能设置空间的宽度为屏幕宽度的百分比?
伊谢尔伦
伊谢尔伦 2017-04-17 15:19:57
0
2
804

我在storyboard中设置layout,假如我设置了button, 水平居中,我可不可以设置button的宽度为屏幕宽度的百分比?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(2)
伊谢尔伦

Select the button and click control to connect to viewController.view, which is the view with the usual screen width

Select

Then click Size inspector->Constraints to find the corresponding item, click Edit, and adjust the multiplier

迷茫

This is possible, but the setting is not the ratio to the screen, but the ratio to Superview. UIViewController.view.width Equivalent to screen width.
Because there are a lot of steps, I wrote an article specifically. Storyboard usage tips: Use proportional layout

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template