いくつかの理由で、アプリを横向きモードでのみ動作するように制限していますが、奇妙なことに、アプリからiPodミュージックライブラリを開くと、常に縦向きモードでジャンプします。
次のコードを参照してください。システムのデフォルトの動作かどうか混乱していますか?ランドスケープモードで表示されるようにするにはどうすればよいですか(他のUIとの一貫性を保つ)?ありがとう。
- (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;
}
}