我的应用仅使用纵向模式。但是 ABPeoplePickerNavigationController 支持横向。是否可以让 ABPeoplePickerNavigationController 仅支持纵向模式?
问问题
1032 次
1 回答
2
子类化并覆盖shouldAutorotateToInterfaceOrientation:
// .h file
@interface MMABPeoplePickerPortraitOnlyNavigationController : ABPeoplePickerNavigationController
@end
// .m file
@implementation MMABPeoplePickerPortraitOnlyNavigationController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}
@end
于 2012-07-20T18:00:04.503 回答