Tại sao không thử gọi phương thức shouldAutorotate và xem giá trị BOOL nào được trả về?
Tôi chưa thử tìm khóa UIOrientation. Nhưng ngoài đỉnh đầu của tôi, đây là cách tôi muốn thử.
if([self shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeLeft])
NSLog(@"Rotates LandscapeLeft");
if([self shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeRight])
NSLog(@"Rotates LandscapeRight");
if([self shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationPortrait])
NSLog(@"Rotates Portrait");
if([self shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationPortraitUpsideDown])
NSLog(@"Rotates PortraitUpsideDown");
Hy vọng điều này sẽ giải quyết được vấn đề của bạn.
Nguồn
2011-07-13 15:18:58
bản sao có thể có của [Hướng thiết bị iOS bỏ qua khóa định hướng] (http://stackoverflow.com/questions/4574693/ios-device-orientation-disregarding-orientation-lock) – CRABOLO