84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
我在storyboard中设置layout,假如我设置了button, 水平居中,我可不可以设置button的宽度为屏幕宽度的百分比?
小伙看你根骨奇佳,潜力无限,来学PHP伐。
选择button,点control连接到viewController.view,也就是通常的屏幕宽度的view
选择
然后点击Size inspector->Constraints找到对应的项目,点击Edit,调整multiplier
这个是可以的,但是设置的不是和屏幕的比例,而是和Superview的比例。UIViewController.view.width相当于屏幕宽度。 因为操作步骤有点多,我特地写了篇文章。Storyboard使用技巧:使用比例方式布局
UIViewController.view.width
选择button,点control连接到viewController.view,也就是通常的屏幕宽度的view
选择
然后点击Size inspector->Constraints找到对应的项目,点击Edit,调整multiplier
这个是可以的,但是设置的不是和屏幕的比例,而是和Superview的比例。
UIViewController.view.width
相当于屏幕宽度。因为操作步骤有点多,我特地写了篇文章。Storyboard使用技巧:使用比例方式布局