可能重複:
How to force a screen orientation in specific view controllers?iphone進行定向
你好
我想設置一個特定視圖我怎麼能做到這一點的方向。並且身體有這樣的例子。我使用的
-(void)onUIDeviceOrientationDidChangeNotification:(NSNotification*)notification{
UIViewController *tvc = self.navigationController.topViewController;
UIDeviceOrientation orientation = [[ UIDevice currentDevice ] orientation ];
tabBarController.view.hidden = YES;
// only switch if we need to (seem to get multiple notifications on device)
if(orientation != [[ UIApplication sharedApplication ] statusBarOrientation ]){
if([ tvc shouldAutorotateToInterfaceOrientation: orientation ]){
[ self rotateInterfaceToOrientation: orientation ];
}
}
}
但它所做的是整個應用程序,我想只有在一個屏幕上完成,所以請回復 謝謝
你想爲你的應用程序應用單一的方向? – ajay 2011-05-11 07:37:07
重複的http://stackoverflow.com/questions/314382/how-to-force-a-screen-orientation-in-specific-view-controllers,http://stackoverflow.com/questions/3686303/uiviewcontroller-rotating - 問題和http://stackoverflow.com/questions/5297103/how-to-set-screen-orientation-like-landscape-view-programmaticaly-in-iphone – 2011-05-11 06:57:00