0
這是我的問題: - 我有一個navcontroller,裏面有一個帶4視圖控制器的tabbar控制器。 - 我想增加以下功能: - 在landscapeRight辭退navcontroller,的TabBar控制器以及一切和加載全新的控制器 - 這種人去好了,這裏是代碼:從水平視圖切換導致iPhone應用程序崩潰
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
MyAppDelegate *appDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
// Just delete the lines for the orientations you don't want to support
if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
[appDelegate ToHorizontalAverageResponseView:self];
}
return YES;
}
這裏是在代碼應用委託:
- (void)ToHorizontalAverageResponseView:(id)sender
{
HorizontalResponseViewController *tempController = [[HorizontalResponseViewController alloc] initWithNibName:nil bundle:nil];
[self setHorizontalResponseViewController: tempController];
[tempController release];
//[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeRight;
// View rotation transformation
CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation(M_PI * 90.0/180.0);
[[horizontalResponseViewController view] setTransform:landscapeTransform];
[window addSubview:[horizontalResponseViewController view]];
}
問題是如何轉回到縱向視圖和所有那些導航欄和標籤欄控制器?
THX, 姆拉登
我不記得它是哪一個講座,但它是前六個之一。他們可以在iTunes U上找到視頻。 – Hauke 2009-09-16 12:22:21