自动旋转UIImageView子视图

时间:2009-09-04 21:33:54

标签: iphone uiimageview rotation subview

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

但我的所有子视图都以纵向显示。如何在我的子视图中更改此内容?

由于 //:)

1 个答案:

答案 0 :(得分:1)

你有一个viewcontroller吗?你的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));
}

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