通过使用Xcode 8,具有单个故事板的不同iPhone设备 [英] Different iPhone devices with single storyboard by using Xcode 8

查看:89
本文介绍了通过使用Xcode 8,具有单个故事板的不同iPhone设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于我之前问的问题,

为iPhone和iPad保留单个故事板

我已完成上述问题.我通过使用

I done with above issue. I successfully created the iPhone and iPad design with single storyboard by using

特征变化

但是现在我的问题是,我想根据iPhone屏幕尺寸的不同,使按钮的宽度和高度以及所有相关的约束条件不同. 如果我使用特质变化",它将为iPhone的所有屏幕尺寸更新按钮.

But now my issue is , I want to make button's different width and height and all related constraints according to the different iPhone screen sizes. If I am using "Vary of traits" it will update button for all screen sizes for iPhone.

例如:

  1. iPhone 6:我想从超级视图中设置按钮顶部约束为100
  2. iPhone 5s:我想将超级视图的按钮顶部约束设置为60

请为此建议我.

任何帮助或建议表示赞赏.

Any help or suggestion appreciated.

推荐答案

topConstraint.constant = xx
self.view.layoutIfNeeded()

这篇关于通过使用Xcode 8,具有单个故事板的不同iPhone设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆