ABPeoplePickerNavigationController和UIImagePickerController在ipad iOS7上无法正确显示

当我尝试使用“ABPeoplePickerNavigationController”或“UI ImagePickerController”时,在大多数情况下它将无法正确加载.它将显示iOS 7(ipad)屏幕中部的模拟器和设备(屏幕截图)的一部分屏幕(透明).在iOS 8中,一切正常.

这是我为ABPeoplePickerNavigationController使用的代码:

ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
self.preserveCurrentEntity = YES;
[self presentViewController:picker animated:NO completion:nil];

UIImagePickerController将打破视频摘录,但为其他任何工作,这是我使用的代码:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];

switch (buttonIndex) {
    case ImagePickerModeCamera:
            imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
        break;
    case ImagePickerModeAlbum:
        imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        break;
    default:
        break;
}
imagePicker.delegate = self;

NSMutableArray *mediaType = [[NSMutableArray alloc] init];

switch (self.actionSheetType) {
    case ActionSheetTypeImage:
        [mediaType addObject:(NSString*)kUTTypeImage];
        break;
    case ActionSheetTypeVideo: {
        [mediaType addObject:(NSString*)kUTTypeMovie];
        [mediaType addObject:(NSString*)kUTTypeVideo];
        imagePicker.allowsEditing =NO;
    }
        break;
    default:
        break;
}

imagePicker.mediaTypes = mediaType;
[self presentViewController:imagePicker animated:NO completion:nil];

这是iOS7中加载ABPeoplePickerNavigationController时发生的情况:

这是iOS8中加载ABPeoplePickerNavigationController时发生的情况:

解决这个问题的办法是什么?

看来我发现我的问题的解决方案.

我有一个根视图控制器,有两个xib,一个用于iPad,一个用于iPhone.即使它们非常相似(只有一个较大),似乎我的iPad是造成麻烦的.我不知道为什么.

我现在只使用iPhone,并确保它在iPad上正确调整大小,一切正常.

相关文章
相关标签/搜索