[英]View has different position on iphone 4 and 5/6 without Auto-layout
I am not using auto-layout but I have a view on storyboard (using the interface builder) which on the view attributes has this : 我没有使用自动布局,但我在情节提要板上有一个视图(使用界面生成器),该视图在view属性上具有以下内容:
X : 0 , Y : 43, Width :325, Height : 362.
I am not using auto-layout and the view on the IB has a fixed simulated size. 我没有使用自动布局,并且IB上的视图具有固定的模拟大小。
On iphone 4 - the view's dimension become : 在iPhone 4上,视图的尺寸变为:
ContainerView. X : 0.000000 Y:63.000000 Height :362.000000 Width : 325.000000
On iphone 5/6 they become : 在iPhone 5/6上,它们变为:
ContainerView. X : 0.000000 Y:151.000000 Height :362.000000 Width : 325.000000
So, Y is different. 因此,Y是不同的。
ViewController does not use navigation bars or anything else. ViewController不使用导航栏或其他任何东西。
Thanks 谢谢
If you disable AutoLayout this means you are using Autoresizing which has limited feature of adapting your view to size and orientation changes. 如果禁用“自动版式”,则意味着您正在使用“自动调整大小”,该功能具有使视图适应大小和方向变化的有限功能。 Check your Autoresizing masks
检查您的自动调整大小的面具
Recommended way to use AutoLayout with size classes so you can fine tune all the UI components according to different size and orientation. 推荐的将AutoLayout与尺寸类结合使用的方法,以便您可以根据不同的尺寸和方向微调所有UI组件。 You may take a look official Apple documentation for reference
您可以看一下Apple的官方文档以供参考
https://developer.apple.com/library/ios/recipes/xcode_help-IB_adaptive_sizes/chapters/AboutAdaptiveSizeDesign.html https://developer.apple.com/library/ios/recipes/xcode_help-IB_adaptive_sizes/chapters/AboutAdaptiveSizeDesign.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.