简体   繁体   English

iPhone自动旋转屏幕上的太多对象

[英]iPhone autorotation for too many objects on screen

I have a BlahAppDelegate, BlahViewController and no nibs in my iPhone app project. 我的iPhone应用程序项目中有BlahAppDelegate,BlahViewController并且没有笔尖。 Only some subclasses of UIView in addition. 除了UIView的一些子类。 All this is situated in main.m. 所有这些都位于main.m中。 My app has 6 subclassed UIViews. 我的应用程序有6个子类化的UIView。 Each of it contains 18 UIImageViews. 每个包含18个UIImageViews。

I need to get autorotating work. 我需要进行自动旋转工作。 Or custom rotating. 或自定义旋转。 Or something. 或者其他的东西。 For example it would be nice to fade the screen out when device is rotated, then move/resize views and then fade screen out. 例如,最好在旋转设备时淡出屏幕,然后移动/调整视图大小,然后淡出屏幕。 But I don't know how to automate it, without writing a resizing code for each of objects. 但是我不知道如何自动化,而无需为每个对象编写一个调整大小的代码。

Please help me if you can. 如果可以,请你帮助我。

The simplest approach would be to use the autoresizingMask property of your image views. 最简单的方法是使用图像视图的autoresizingMask属性。 These act just like the springs-and-struts in IB. 这些行为就像IB中的弹簧和支柱一样。 If you position your views relative to their parents, and set these appropriately, you should have no problems. 如果您相对于父母定位您的观点,并适当地设定这些观点,那么您应该没有问题。 However, your options are somewhat limited; 但是,您的选择有所限制。 basically fixed distance from the edge, or proportionally spaced. 到边缘的距离基本上是固定的,或者成比例地隔开。 No child-relative alignment is possible using just the flags. 仅使用标志就不可能实现子相对对齐。

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

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