亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術(shù)文章
文章詳情頁

objective-c - 如何旋轉(zhuǎn)嵌入U(xiǎn)IWebView的視頻(iOS 7)?

瀏覽:137日期:2024-04-12 11:42:38

問題描述

我在開發(fā)的APP是面向肖像的,但是當(dāng)運(yùn)行視頻(內(nèi)嵌在webview)的時(shí)候,我需要在風(fēng)景模式下重新定位視頻。應(yīng)該怎么解決這一問題呢?我找到了一種解決方案,似乎可以解決問題。我覺得這是因?yàn)閕OS 7的更新,但是我不確定。所以,這是我先前使用的,但是現(xiàn)在不起作用了,因?yàn)榇翱诤皖惷偸莕il。

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{id presentedViewController = [window.rootViewController presentedViewController];NSString *className = presentedViewController ? NSStringFromClass([presentedViewController class]) : nil;if (window && [className isEqualToString:@'MPInlineVideoFullscreenViewController']) { return UIInterfaceOrientationMaskAll;} else { return UIInterfaceOrientationMaskPortrait;}

原問題:How to rotate a video embed in UIWebView (for iOS 7 only)?

問題解答

回答1:

答案:Denisia我自己找到了解決方法!在AppDelegate中執(zhí)行如下方法,成功了!我的問題是,開始的時(shí)候,我沒有檢查右視圖控制器(view controller)。

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {NSString *className = NSStringFromClass([window class]);if ([((UINavigationController *)window.rootViewController) respondsToSelector:@selector(visibleViewController)]) { className = NSStringFromClass([((UINavigationController *)window.rootViewController).visibleViewController class]);}if ([className isEqualToString:@'MPFullscreenWindow'] || [className isEqualToString:@'MPInlineVideoFullscreenViewController']) { return UIInterfaceOrientationMaskAll;} else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){ return UIInterfaceOrientationMaskLandscape;} else { return UIInterfaceOrientationMaskPortrait;}

Immi試試這個(gè):

-(BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation{return YES;}

如果你想在屏幕不顯示視頻的時(shí)候,不讓UIViewController旋轉(zhuǎn),就使用下面的:

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{if(webView && webView.superView) return YES;return UIInterfaceOrientationIsPortrait(interfaceOrientation);}

標(biāo)簽: web
相關(guān)文章:
主站蜘蛛池模板: 婷婷综合七月激情啪啪 | 男女叼嘿视频大全免费看 | 成人网在线观看 | 国产成人8x视频一区二区 | 亚洲视频在线观看视频 | 亚洲六月丁香色婷婷综合久久 | 黄色在线视频在线观看 | 免费视频a | 99久久er热在这里只有精品16 | 日本亚洲黄色 | 欧美特级特黄a大片免费 | 日本毛片在线看 | 成人黄色三级视频 | 激情开心| 一区二区三区免费在线观看 | 免费观看a毛片一区二区不卡 | 亚洲精品日韩在线一区 | 欧美视频在线一区二区三区 | 亚洲色图偷拍自拍 | 免费黄网在线 | 美国黄色一级片 | 国产精品美女免费视频观看 | 午夜黄色一级片 | 国产精品久久久久网站 | 国产女人精品性视频 | 欧美高清视频www夜色资源网 | 精品久久香蕉国产线看观看亚洲 | 亚洲精品专区一区二区欧美 | 日本不卡毛片一二三四 | 久久香蕉国产线看观看精品蕉 | 99精品网站| 欧美最大成人毛片视频网站 | 真正国产乱子伦高清对白 | 日本免费不卡一区 | 免费黄毛片 | 免费在线看黄网址 | 久久久久久久99精品免费观看 | 成人高清毛片a | 国产午夜一级鲁丝片 | 中文字幕 亚洲精品 第1页 | 国内精品久久久久久久久久久久 |