2013-10-10 2 views
9

나는 이런 종류의 문제가있는 사람이 아닙니다. 다른 하나는 Status bar height changes after playing a Youtube video입니다. 그러나 나는 이것을 해결할 수있는 방법을 찾을 수 없다. 나는 MPMoviePlayerController를 사용하지 않는다. 나는이 코드들을 사용해야 만한다고 생각한다;동영상 재생 후 상태 표시 줄이 사라집니다.

[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO]; 

self.webView.frame = CGRectMake(0.0, 
           20.0, 
           self.webView.frame.size.width, 
           self.webView.frame.size.height); 

하지만 그렇게 작동하지 않습니다.

먼저 내 "홈"의 모습이다에서 .. 다음이 이미지

enter image description here

를 참조하십시오. 유튜브/비 메오 (또는 무엇이든)에서 비디오를 재생하는 동안

enter image description here

상태 표시 줄이 사라집니다. 내가 돌아 갈 때

enter image description here

는, 그들이 오므 참조하십시오.

enter image description here

이 처리하는 방법이 FB 그림을 발견했다. 상태 표시 줄이 바로 나타났습니다.

어떤 도움말 ???

미리 환호하십시오!

+0

저도 같은 문제가 발생하고 있습니다. 이것에 대한 해결책을 찾았습니까? – user2955351

답변

1

귀하의 경우에 적용할지 모르겠지만 제 경우에는 UIImagePickerController를로드하고 기본 화면 방향을 변경 한 후에 상태 표시 줄이 나타납니다.

이 상황을 해결합니다. application.statusBarHidden = YES; 이 같은 내부 AppDelegate에 :

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { 
// Detect if I need to hide the StatusBar (optional) 
if (iNeedToHide == YES) { 
    application.statusBarHidden = YES; 
} 
return UIInterfaceOrientationMaskLandscape; 

} 나는이 당신을 도움이되기를 바랍니다

.

+0

죄송합니다. 비디오를 재생할 때 상태 표시 줄을 나타나게하여 다른 화면의 탐색 표시 줄에 상태 표시 줄을 표시하지 않도록해야합니다. 나는 Youtube/Vimeo 사이트를 열 때 나타나지 만 비디오를 재생하면 사라져 버린다. – caribbean

+0

비디오 컨트롤이 일종의 내비게이션 컨트롤러인지는 모르겠지만이 델리게이트 프로 시저를 사용할 수 있다면 상태 표시 줄을 숨 깁니다 : // (null) navigationController : (UINavigationController *) navigationController willShowViewController : (UIViewController *) viewController animated : (BOOL) animated {// Esconder statusBar.[UIApplication sharedApplication] setStatusBarHidden : 예 withAnimation : UIStatusBarAnimationNone]; } – Beto

1

비디오 플레이어를 닫을 때 애니메이션을 비활성화해야했습니다. 비디오에 대한 통지가 마무리 이벤트를했던 장소 :

[[NSNotificationCenter defaultCenter] addObserver:self 
              selector:@selector(videoDidFinish:) 
               name:MPMoviePlayerPlaybackDidFinishNotification 
               object:controller.moviePlayer]; 

그런 다음,이 방법 안에, 애니메이션없이보기 컨트롤러를 기각 :

- (void)videoDidFinish:(NSNotification *)notification { 
    [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification 
                object:controller.moviePlayer]; 
    [self dismissViewControllerAnimated:NO completion:nil]; 
} 
관련 문제