开发者

Rotation of UISplitview in Tabbarcontrol

开发者 https://www.devze.com 2023-02-21 22:21 出处:网络
I have a Tabbar control (as the root control). In the first tab, I have a split view, which I programmatically created like so:

I have a Tabbar control (as the root control). In the first tab, I have a split view, which I programmatically created like so: UISplitViewController *split = [[[UISplitViewController alloc] init] autorelease]; split.navigationItem.title = @"All";

MasterSplitViewController *root = [[[MasterSplitViewController alloc] init] autorelease]; root.navigationItem.title = @"Areas"开发者_如何学Python; root.detailViewController = detail;

UINavigationController *nav = [[[UINavigationController alloc] initWithRootViewController:root] autorelease];

split.tabBarItem = controller.tabBarItem; split.viewControllers = [NSArray arrayWithObjects: nav, detail, nil]; split.delegate = detail;

Everything works fine, except... If I start the app in Landscape mode, then the layout breaks a bit on the Master view. If the app starts in Portrait, then I rotate to Landscape, then it is fine. The only scenario when it breaks is when the app starts in Landscape.

When this happens, I check the console and see this message: Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations. BUT I am not using a two-stage rotation anywhere!! These 2 functions are overridden:

shouldAutorotateToInterfaceOrientation and willAnimateRotationToInterfaceOrientation

Please see the attached screen shot. http://img97.imageshack.us/i/screenshot20110405at308.png/

Please help me. Any suggestion would be greatly appreciated. Thanks very much!!


I had this problem. Add this code to AppDelegate.m.

self.tabBarController.selectedIndex = 0;
0

精彩评论

暂无评论...
验证码 换一张
取 消