【问题标题】:Auto rotation of UIImageView subviewsUIImageView 子视图的自动旋转
【发布时间】:2009-09-04 21:33:53
【问题描述】:

根视图是一个 UIImage 视图,它有子视图,那些有子视图。我的根视图将在横向打开我已经在项目的 .plist 中设置了两个项目属性,并在 applicationDidFinishLaunching 中集成了 application.statusBarOreintation 并验证它是否有效。

但是我所有的子视图都以纵向显示。如何在我的子视图上更改此设置?

谢谢 // :)

【问题讨论】:

    标签: iphone uiimageview rotation subview


    【解决方案1】:

    你有视图控制器吗?你的 shouldAutorotateToInterfaceOrientation 返回什么?

    // Override to allow orientations other than the default portrait orientation.
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        // Return YES for supported orientations
        return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || 
                (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
    }
    

    如果没有视图控制器,您将不得不应用变换来旋转您加载的每个视图。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多