2012-03-22 51 views
0

我已经搜索了几个小时来回答我的问题,并没有发现任何似乎工作。所以,请接受我的道歉,如果这个问题已经得到解答...HTML应用程序的风景取向

我是非常新的应用程序开发,并已建议使用XCODE和PhoneGap建立和编译的HTML,CSS,jQuery的路线。 经过大量的拖拽之后,我设法构建了一个html页面并通过XCODE对其进行测试。

我的问题是我无法强制定位到风景。

我找到了解决方案,在我已经完成的.plist文件中设置方向。这将更改工具栏和查看窗口的方向,但内容(HTML)保持纵向模式。

我发现如果有人创建了只有横向模式中测试应用程序的例子后,大我想,但不幸的是,这是客观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? 是否有一个jQuery/JavaScript的HTML应用程序的解决方案?

我很欣赏这是一个“小小”的问题,可能有多个答案。我会很感激任何人可以提供的帮助或方向。

如果已经解决了这个问题,正如我对一个重复的问题表示歉意,但也有很多类似的问题,很难全部通过!

在此先感谢!

回答

0

我注意到有几个人看过。我已经设法找到我的问题的答案,并希望发布它,只要incase其他人有类似的问题。

要获得用HTML编写的应用程序的内容出现在你需要去(在Xcode) 文件夹(应用程序名称)横向模式 - >类 - > 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); 
} 

这应该工作:-)