2010-01-21 139 views
0

我视图层次结构如下所示:iPhone旋转不会旋转的UIWebView

标签栏 - >导航栏 - >表视图 - >视图 - >视图(UIWebView的)

我怎么能旋转查看2所以它可以在纵向模式中显示&?

回答

4

继承人您的修复......刚刚解决了同样的问题。问题是标签栏控制器不响应shouldRotate方法。

忽略苹果文档中的建议并为选项卡视图控制器创建子类。在该子类处理shouldRotate

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { //总是返回YES表示的视图会旋转,以适应任何 取向。 返回YES; }

我的继承人完整的子类 TSTabBarController.h

#import <Foundation/Foundation.h> 
@interface TSTabBarController : UITabBarController { 

} 

@end 

和实现文件。

#import "TSTabBarController.h" 


@implementation TSTabBarController 
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    // Always returning YES means the view will rotate to accomodate any orientation. 
    return YES; 
} 


@end 

如果您更改IB中用于标签栏控制器的类,您应该工作。

希望这会有所帮助。
Rich