모두 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