For some reasons I restrict my app to work only on landscape mode, but strangely when I open iPod music library from my app, it will always jump out in portrait mode.
See the following code, I am confused whether it is system default behavior? How can I tell it to come out in landscape mode (keep consistent with other UI)? Thanks.
- (IBAction)getMusic:(id)sender {
MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeMusic];
picker.delegate = self;
picker.allowsPickingMultipleItems = YES;
picker.prompt = NSLocalizedString (@"Add songs to play",nil);
[self presentModalViewController: picker animated: NO];
[picker release];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return UIInterfaceOrientationIsLandscape(interfaceOrientation);;
} else {
return YES;
}
}