12

When I try use "ABPeoplePickerNavigationController" or "UIImagePickerController", in most cases it won't load up correctly. It will show part of the screen (transparent) starting in the middle of the screen in iOS 7 (ipad) for both simulator and device (screenshot below). In iOS 8 everything works correctly.

This is the code I use for ABPeoplePickerNavigationController:

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

UIImagePickerController will break just for picking videos, but work for everything else, this is the code I use:

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];

This is what happens in iOS7 when loading ABPeoplePickerNavigationController:

iOS 7

This is what happens in iOS8 when loading ABPeoplePickerNavigationController:

iOS8

What is the solution to fix this?

2 Answers 2

5

Looks like I found the solution to my problem.

I have a root view controller that has two xibs, one for iPad and one for iPhone. It seems my iPad one was causing the trouble even though they were very similar (just one was larger). I couldn't figure out why.

I just use the iPhone one now and make sure it resizes correctly on iPad and everything is working correctly.

4
+25

I have the same problem like you, but after wasting some time I got some post, that what may be the reason in your case.

iPhone Library does not work on the iOS Simulator in special case of picking Vedio

Referred Post for my solution. and worked for me.

Update on it, if you still facing problem, I can post my code to help you.

HTH, Enjoy Coding !!

2
  • The issue isn't just on the simulator though. Commented Apr 15, 2015 at 22:02
  • 1
    I have coded same like you, if you need my code, I can update answer. Commented Apr 16, 2015 at 4:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.