【问题标题】:UIWebview Landscape support in Hybrid Application混合应用程序中的 UIWebview Landscape 支持
【发布时间】: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


    【解决方案1】:

    最后通过应用各种技巧,我找到了解决方案。我在以下链接中发布:

    http://cocoainios.blogspot.in/2014/11/implement-orientation-modes-in-iphone.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-11
      • 1970-01-01
      • 1970-01-01
      • 2014-05-04
      • 1970-01-01
      • 2012-11-01
      相关资源
      最近更新 更多