oplePickerNavigationController中的

oplePickerNavigationController中的

我的应用仅使用纵向模式。但是ABPeoplePickerNavigationController支持横向。是否有可能ABPeoplePickerNavigationController仅支持纵向模式?

最佳答案

子类化并覆盖shouldAutorotateToInterfaceOrientation:

// .h file
@interface MMABPeoplePickerPortraitOnlyNavigationController : ABPeoplePickerNavigationController
@end

// .m file
@implementation MMABPeoplePickerPortraitOnlyNavigationController

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}

@end

关于objective-c - Objective-C-锁定ABPeoplePickerNavigationController中的旋转,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9120274/

10-11 02:45