2011-02-01 4 views
0

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

}`

+0

왜 회전시 값을 프로그래밍 방식으로 변경하고 있습니까? –

+0

왜냐하면 내가보기를 벗어난다면 화면이 바뀌기 때문이다. – user598789

답변

0

그런데 문제는 여기에 내가보기를 회전`에서 크기를 조정 한 것이 었습니다 - (무효) didRotateFromInterfaceOrientation : (UIInterfaceOrientation) fromInterfaceOrientation. 무비 플레이어가 자동으로 그렇게하므로 반드시 그렇게 할 필요는 없습니다. 프레임 크기 조정 및 회전은 실제로 버튼이 혼란스러워서 탭했을 때 터치 이벤트를받지 못했습니다.

관련 문제