0
我有一個推UIViewController(孩子)的UINavigationController(父)。我知道這兩個都需要支持:如何爲子視圖執行橫向方向,但不是父視圖?
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return YES; //(interfaceOrientation == UIInterfaceOrientationPortrait);
}
但是,我不希望家長能夠旋轉橫向。我如何執行此操作?
UPDATE:
我的父母已經更新到:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if (interfaceOrientation != UIInterfaceOrientationLandscapeRight ||interfaceOrientation != UIInterfaceOrientationLandscapeLeft)
return NO;
else
return YES;
}
但現在的孩子不旋轉。
我已修改了小幅的代碼,因爲UIIntefaceOrientationLandscape不編譯瓦特/ iOS4的。但是,孩子停止旋轉。 – 2010-07-02 20:45:34