我想加載與shouldAutorotateToInterfaceOrientation
方法的視圖,但我有一個問題。當設備以橫向模式運行時,我想要顯示主視圖本身,以及當設備是縱向時,加載自定義UIView。加載主視圖與shouldAutorotateToInterfaceOrientation
這裏是我的代碼:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft)|| (interfaceOrientation == UIInterfaceOrientationLandscapeRight))
//doesn't show main view !!
self.view;
else if ((interfaceOrientation == UIInterfaceOrientationPortrait) || (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown))
//works fine !
self.view = portraitView;
return YES;
}
我想通了!!!!我用一種方法的模態來稱呼我的觀點。 – Momi 2010-12-17 21:09:22