- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
最佳答案
当我遇到同样的问题时,我开始使用 autoAutoLayout,效果很好。
https://github.com/cathyxchen/autoAutoLayout
示例
只需在 Interface Builder 中构建您的界面或以编程方式创建它。然后不创建任何约束,只需将控件放置在您想要的位置即可。
在那之后就放置
[self.view removeConstraints:self.view.constraints];
[AutoAutoLayoutlayoutFromBaseModel:@"5"forSubviewsOf:self.view];
在您的 ViewController.m 中。 (我放在了viewDidLoad方法中)
现在,它根据 BaseModel(在我的 iPhone5 案例中)计算控件到所有其他 iPhone 显示屏尺寸的位置。
代码说明
[self.view removeConstraints:self.view.constraints];
这会删除所有约束,只是为了确保没有隐藏和受监督的约束。
[AutoAutoLayout layoutFromBaseModel:@"5"forSubviewsOf:self.view];
这会调用方法来重新计算 BaseModel 中的新位置。
关于ios - 如何在 iPhone 6 plus 上放大布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32086412/
我是一名优秀的程序员,十分优秀!