OGeek|极客世界-中国程序员成长平台

标题: ios - PhoneGap 上的 childBrowser 仅纵向显示 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 09:28
标题: ios - PhoneGap 上的 childBrowser 仅纵向显示

我正在为 iOS 5.0、XCODE 4.2、phonegap 1.1.0 使用 childbrowser,我只能在纵向模式下将其拉起。我的应用程序支持所有 4 个 View ,但是当我选择一个时,我的浏览器仅处于纵向模式。我确实收到此错误消息:

View Controller 从 -shouldAutorotateToInterfaceOrientation: 返回 NO,用于所有界面方向。它应该至少支持一个方向。

但我对 xcode 知之甚少 - 所以我无法解决这个问题

帮助



Best Answer-推荐答案


我遇到了同样的问题,如果您查看 ChildBrowserViewController 有一个名为 shouldAutorotateToInterfaceOrientation 的函数。

前几行查看支持的方向配置,但仅当您有多个方向设置时它才会旋转。我只有横向设置,所以它没有这样做。

如果你将 autoRotate 设置为 YES 或者注释掉 if block ,它会检查当前方向是否被支持,如果支持就会旋转到它。

- (BOOL)shouldAutorotateToInterfaceOrientationUIInterfaceOrientation) interfaceOrientation 
{
    //BOOL autoRotate = [self.supportedOrientations count] > 1; // autorotate if only more than 1 orientation supported
    //if (autoRotate)
    //{
        if ([self.supportedOrientations containsObject:
             [NSNumber numberWithInt:interfaceOrientation]]) {
            return YES;
        }
    //}

    return NO;
}

关于ios - PhoneGap 上的 childBrowser 仅纵向显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7817253/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4