简体   繁体   English

iPhone中的视图向下移动

[英]View is moving down in iphone

I am using slide out navigation in my app. 我在我的应用程序中使用滑出导航。 In that some pages view slide down automatically sometimes. 在某些页面视图中,有时会自动向下滑动。 In simulator it is in perfect position while in some device it looks perfect and in some it slide down. 在模拟器中,它处于完美的位置,而在某些设备中,它看起来非常完美,而在某些设备中,它可以向下滑动。 Here is screen shots: 1)Simulator screen shot(should look like): 这是屏幕截图:1)模拟器屏幕截图(看起来像): 在此处输入图片说明

2)device screen shot: 2)设备屏幕截图:

在此处输入图片说明

You can see by back whit sun that view is moving down. 您可以通过逆时针太阳看到视图正在向下移动。 I have set that image as background color of view. 我已将该图像设置为视图的背景色。 There something auto-resizing property which I have to set but I tried many thing but same result can any one tell me why exactly this is happening? 我必须设置一些自动调整大小的属性,但是我尝试了很多事情,但相同的结果可以告诉我为什么会这样吗?

i think auto-resizing is right option to display uiview correctly on device try out one of following property which might help 我认为自动调整大小是在设备上正确显示uiview的正确选项,尝试以下属性之一可能会有所帮助

these are the available option for ios 7 for resizing uiview you can add add just one line of code to correct this 这些是ios 7调整uiview大小的可用选项,您可以添加仅添加一行代码来更正此问题

view.autoresizingMask = UIViewAutoresizingFlexibleTopMargin; view.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;

or 要么

view.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | view.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin; UIViewAutoresizingFlexibleBottomMargin;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM