UITabBar Autorotation

时间:2012-03-11 00:24:16

标签: iphone objective-c ios4

所以这是我的问题。

我正在使用我的MainViewcontroller的子视图以下列方式实现TabBar:

@class MainViewController;

@interface MyAppDelegate : NSObject <UIApplicationDelegate>
{

  // UITabBarController root controller view
  UITabBarController *rootController;
}

// Added
@property (nonatomic, retain) IBOutlet UITabBarController *rootController;

@end

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary 
*)launchOptions
{    

   // Added root controller
   [self.window addSubview:rootController.view];

   return YES;
}

我有4个视图控制器和4个选项卡。我已在每个选项卡视图.m和主视图控制器中指定:

// Autoration of view orientations 
 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}

我在主视图控制器中没有旋转到任何方向。我认为我需要覆盖主视图,但我的理解还不够。请帮助我。

1 个答案:

答案 0 :(得分:0)

看看this。在this question here

相关问题