【发布时间】:2014-11-27 06:07:18
【问题描述】:
我正在使用 UIWebview 开发一个混合应用程序。所有的 HTML 页面都是从本地加载的。我要求只有一页应该同时支持横向和纵向模式。其余所有 html 页面应仅支持纵向模式。 所以我为此做了以下实现:
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
if (isFullScreenPlaying) {
NSLog(@"**********************************orienattion Landscape%@",[window description]);
return UIInterfaceOrientationMaskAllButUpsideDown;
}
NSLog(@"**********************************orienattion Portrait%@",[window description]);
return UIInterfaceOrientationMaskPortrait;
}
当我的 url 请求等于全屏播放时,我启用了 isFullScreenPlaying 变量:
**if([urlString hasPrefix:@"fullscreenvieweron://"]){
NSLog(@"**********************************isFullScreenPlayingYes");
isFullScreenPlaying = YES;
return NO;
}**
但问题出现在用户横向旋转设备后。全屏 html 页面以横向模式出现。 Bur 当用户关闭全屏 html 页面时,之前加载的页面也处于横向模式。在 HTML 或 Native IOS 端有什么方法可以为特定的 html 页面设置方向支持吗?
【问题讨论】:
标签: ios objective-c xcode uiwebview hybrid-mobile-app