Các tài liệu nói:UIInterfaceOrientationLandscapeLeft và UIInterfaceOrientationLandscapeRight được đảo ngược?
UIInterfaceOrientationLandscapeLeft
Thiết bị này là ở chế độ nằm ngang, với các thiết bị cầm thẳng đứng và nút home ở phía bên phải.
UIInterfaceOrientationLandscapeRight
Thiết bị này là ở chế độ nằm ngang, với các thiết bị cầm thẳng đứng và nút home ở phía bên trái.
Tuy nhiên, tôi nhận được chính xác họ bị đảo ngược. Có thể thực sự là một sai lầm trong SDK, hay tôi chỉ phát điên?
Code:
+ (NSString *)NSStringFromUIInterfaceOrientation:(UIInterfaceOrientation)o
{
switch (o) {
case UIInterfaceOrientationPortrait: return @"UIInterfaceOrientationPortrait";
case UIInterfaceOrientationPortraitUpsideDown: return @"UIInterfaceOrientationPortraitUpsideDown";
case UIInterfaceOrientationLandscapeLeft: return @"UIInterfaceOrientationLandscapeLeft";
case UIInterfaceOrientationLandscapeRight: return @"UIInterfaceOrientationLandscapeRight";
}
return nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
NSLog(@"Should: %@", [[self class] NSStringFromUIInterfaceOrientation:toInterfaceOrientation]);
return YES;
}
tôi dán đoạn code trên trong RootViewController.m của mẫu ứng dụng mặc định Navigation-based.
Theo dõi: Báo cáo là bug 7216046.
Tôi đọc chính xác. Tôi xoay thiết bị theo chiều kim đồng hồ và nhận UIInterfaceOrientationLandscapeLeft:/ –
Phiên bản SDK nào bạn đang sử dụng? – Tim
3.0 trên Snow Leopard. –