0

I am facing the done button issue in the MPMediaPickerController.

Device: iPod Touch

iOS :9.2   

 MPMediaPickerController  *picker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic];


picker.delegate                     = self;
picker.allowsPickingMultipleItems   = YES;
picker.showsCloudItems = NO;
picker.prompt                       = NSLocalizedString (@"Add songs to play", "Prompt in media item picker");

// The media item picker uses the default UI style, so it needs a default-style
//      status bar to match it visually
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];

[self presentViewController:picker animated:YES completion:nil];

The picker is presenting but the done button is missing in the picker. Incase if I click at the place where we have done button earlier the picker is dismissing. Thank you for spending time for reading my question. Any ideas/suggestion could be very helpful.

SRI
  • 1,514
  • 21
  • 39
  • 1
    What's your view controller hierarchy? Do you use UIAppearance to manipulate the style of anything? If you enter the view debugger, can you see the button and check its attributes? – jcaron Dec 18 '15 at 11:46
  • I have taken one rootview controller and I am presenting on it. I am not using any UIAppearance for any manipulation.Thank you – SRI Dec 18 '15 at 12:05
  • I'm unable to reproduce your problem. Can you provide a minimal project that illustrates the issue? – jcaron Dec 18 '15 at 12:21
  • ok sorry could you please try my code on iOS device 9.2? Just simply created one project and in rootviewcontroller I have written the above code on button action – SRI Dec 18 '15 at 12:28
  • That's what I did, and I see the Done button. I tested on simulator only, though. – jcaron Dec 18 '15 at 12:33
  • I am sorry @jcaron your question Do you use UIAppearance to manipulate the style of anything? really made me thinking about the UIAppearance. Sorry it is a large project and I have searched keyword UIAppearance in my project but didn't find any. After rereading your comment I have searched for appearance. Now I found one line in my project. That was the issue. Thank you so much – SRI Dec 18 '15 at 12:47
  • I added it as an answer, feel free to up vote and/or accept it. – jcaron Dec 18 '15 at 12:53

1 Answers1

0

So, the issue was that the appearance of the button was changed through UIAppearance.

For people stumbling on the same issue, check for the presence of appearance, appearanceWhenContainedIn: or appearanceForTraitCollection: in the project.

jcaron
  • 17,302
  • 6
  • 32
  • 46