【问题标题】:Are there Rotate Webview examples around?周围有 Rotate Webview 示例吗?
【发布时间】:2010-01-12 15:43:45
【问题描述】:

我以为我已经问过这个问题,但我看不到它,所以我会再问一次。

我需要编写一个应用程序,它只包含一个可旋转的 webview。当用户将手机从纵向变为横向或反之时,如何旋转文本?

干杯

保罗

【问题讨论】:

    标签: iphone uiwebview webview


    【解决方案1】:

    这是自动处理的。在您的视图控制器中,覆盖该方法:

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

    并确保您的 webview 的自动调整大小掩码设置如下:

    webView.autoResizingMask = UIViewAutoresizingFlexibleHeight |   UIViewAutoresizingFlexibleWidth;
    

    【讨论】:

    • 您好,感谢您的帮助,是否有关于如何使用自动调整大小对话框的示例?这让我很困惑!不确定如何“确保您的 webview 的自动调整大小掩码设置为 FlexibleWidth | FlexibleHeight”干杯 Paul
    【解决方案2】:

    您是否使用 UIViewController 控制 UIWebView?如果是这样,覆盖

    -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    

    【讨论】:

      猜你喜欢
      • 2018-01-30
      • 1970-01-01
      • 2012-02-28
      • 2012-05-08
      • 2012-09-25
      • 2011-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多