播放视频后,iOS 7状态栏消失 [英] iOS 7 Status Bar Disappears After Playing a Video

查看:159
本文介绍了播放视频后,iOS 7状态栏消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是唯一一个遇到这种问题的人。这是另一个,播放Youtube视频后状态栏高度变化。但我仍然无法找到解决这个问题的方法。我没有使用MPMoviePlayerController。我想我只需要使用这些代码;

I'm not the only one who's having this kind of issue. Here's another one, Status bar height changes after playing a Youtube video. But I can't still find a way to solve this. I'm not using MPMoviePlayerController. I think I just have to use these codes;

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

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

但它不是那么有效。

请看下面这张图片..

Please see this images below..

首先,这就是我的Home的样子。

At first this is what my "Home" looks like.

从Youtube / Vimeo播放视频时状态栏消失(或其他)。

Status bar disappears while playing a video from Youtube/Vimeo (or whatever).

当我回去时,看到他们聚拢了。

When I go back, see them bunched up.

发现FB知道如何处理这个问题。他们的状态栏就在那里。

Found out that FB figure out how to handle this. They had their status bar appears right there.

任何帮助???

提前干杯!

推荐答案

我不得不在解雇视频播放器时禁用动画。发出视频完成事件的通知:

I had to disable the animation when dismissing the video player. Place a notification for video did finish event:

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

然后,在方法内部,关闭视图控制器而不动画:

Then, inside the method, dismiss the view controller without animation:

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

这篇关于播放视频后,iOS 7状态栏消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆