すべて、 [MPMoviePlayerController]の[完了]ボタンは、ポートレートモードでコントロールを閉じます。 しかし、私がランドスケープに回転すると、[完了]と[トグル全画面表示]ボタンの両方が反応しなくなります。 私のアプリはとてもシンプルなアプリで、didRotatefromInterfaceOrientationメソッドがあり、ムービーフレームの幅と高さをランドスケープに変更し、ランドスケープモードと一致するようにオリジンを変更します。MPMoviePlayerControllerランドスケープモードで応答しないボタン
' - (ボイド)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {//ビューのフレームを更新します。 CGRect newFrame = [[UIScreen mainScreen] applicationFrame];
newFrame.origin.x = - (newFrame.size.width/2);
newFrame.origin.y = - (newFrame.size.height/2);
[[self view] setBounds:newFrame];
[[self view] setCenter:CGPointMake([[self view] bounds].size.width/2, [[self view] bounds].size.height/2)];
[self view].userInteractionEnabled = YES;
// Update the frame of the movie player.
newFrame = [[UIScreen mainScreen] applicationFrame];
if(fromInterfaceOrientation == UIInterfaceOrientationPortrait || fromInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
{
newFrame.size.width = newFrame.size.height;
newFrame.size.height = [[UIScreen mainScreen] applicationFrame].size.width;
}
newFrame.origin.x = - (newFrame.size.width/2);
newFrame.origin.y = - (newFrame.size.height/2);
[[[self moviePlayer] view] setFrame:newFrame];
[[[self moviePlayer] view ] setUserInteractionEnabled:YES ];
} `
なぜ値をプログラムで変更するのですか? –
原因私はしない場合、ビューが画面からシフトします。 – user598789