Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/374.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript HTML应用程序横向定位_Javascript_Jquery_Html_Xcode_Cordova - Fatal编程技术网

Javascript HTML应用程序横向定位

Javascript HTML应用程序横向定位,javascript,jquery,html,xcode,cordova,Javascript,Jquery,Html,Xcode,Cordova,我花了几个小时寻找我问题的答案,但没有找到任何有效的答案。所以,如果这个问题已经得到回答,请接受我的道歉 我对应用程序开发非常陌生,有人建议我使用XCODE和PhoneGap来构建和编译html、css、jquery。 经过大量的修改,我成功地构建了一个html页面,并通过XCODE对其进行了测试 我的问题是我不能强迫方向朝向风景 我在.plist文件中找到了设置方向的答案。这会更改工具栏和查看窗口的方向,但内容(HTML)仍处于纵向模式 我发现了一篇示例文章,其中有人仅在横向模式下创建了一个测

我花了几个小时寻找我问题的答案,但没有找到任何有效的答案。所以,如果这个问题已经得到回答,请接受我的道歉

我对应用程序开发非常陌生,有人建议我使用XCODE和PhoneGap来构建和编译html、css、jquery。 经过大量的修改,我成功地构建了一个html页面,并通过XCODE对其进行了测试

我的问题是我不能强迫方向朝向风景

我在.plist文件中找到了设置方向的答案。这会更改工具栏和查看窗口的方向,但内容(HTML)仍处于纵向模式

我发现了一篇示例文章,其中有人仅在横向模式下创建了一个测试应用程序,我认为这很好,但不幸的是,这是在objective C中创建的

例如,它位于名为ViewA.m的文件中

    // ViewA.m

#import "ViewA.h"

@implementation ViewA

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

-(void)viewDidLoad
    {
//  self.view.frame = CGRectMake(0.0, 0.0, 1024.0, 768.0);
    [super viewDidLoad];
    }

@end
这些单独的文件是否适用于HTML和Objective C? 是否有针对html应用程序的jquery/javascript解决方案

我理解这是一个有点“小”的问题,可能有多种答案。如果有人能提供任何帮助或指导,我将不胜感激

如果这个问题已经解决了,就像我对重复的问题说的抱歉,但是有这么多类似的问题,很难全部解决


提前谢谢

我注意到有几个人看过。我已经找到了我的问题的答案,想把它贴出来,以防万一其他人也有类似的问题

要使用HTML编写的应用程序的内容以横向模式显示,您需要转到(xcode) 文件夹(应用程序名称)->Classes->MainViewController.m

你会看到:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
将此更改为

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
这应该行得通:-)