在全屏模式下播放youtube Video时,方向会更改为横向,并且我们会更改方向. [英] Orientation changes to Landscape when youtube Video is played in FullScreen and we change the Orientation.

查看:1367
本文介绍了在全屏模式下播放youtube Video时,方向会更改为横向,并且我们会更改方向.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个UIView并有一个UIWebView.
在UIWebView上,我显示Youtube视频,并且可以播放.

UIView的方向设置为纵向,但是当youtube视频以全屏播放时,我们会更改方向.
它还会更改视图的方向.

但我不想将UIView的方向以及视频更改为横向.
我只希望将方向设为纵向.

同样,UIView的方向也设置为Portrait.


Hi,

I have a UIView and have a UIWebView in it.
On UIWebView i display Youtube Video and it can be played.

The Orientation of UIView is set to Portrait but when the youtube Video is played in full screen and we change the Orientation.
It Also changes the Orientation of the View.

But i dont want to change the Orientation of the UIView and also the Video to Landscape.
I Only want the orientation as Portrait.

Also the orientation of the UIView is set to the Portrait.


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return NO;
}





我已经搜索过,但没有结果....

问候.





I have searched it but no results....

Regards.

推荐答案

尝试返回:
Try returning:
interfaceOrientation == UIInterfaceOrientationPortrait


代替


instead of

return No


这篇关于在全屏模式下播放youtube Video时,方向会更改为横向,并且我们会更改方向.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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