2012-02-06 48 views
0

在我的Sencha-tpuch/phonegap应用程序中,我希望我的应用程序不要改变其使用的设备的方向。我怎么能抑制sencha-touch中的方向变化,或者我会准确地重写什么? thnx!sencha touch ::如何抑制取向变化

+0

谢谢你的回答。但我真的很感兴趣,如果这可能在sencha tuch,而不是xcode或phonegap。 – headkit 2012-02-07 11:11:12

+0

Sencha是**不可**。 – riship89 2012-02-07 16:52:41

回答

2

你不需要编辑任何代码。所有你需要做的就是去你的配置文件,并指定你想要支持的方向。默认情况下,所有4个方向都受支持,您必须对其进行编辑以支持所需的方向。重建应用程序并转到。

该项应该是在下列文件之一:

phonegap.plist/application.plist/config.xml中

同时检查this链接。

由于只有煎茶触摸,因为它不能强制浏览器不改变方向,它是可以消除方向变化。请参阅this链接。

0

在你的PhoneGap Xcode项目发现有文件MainViewController.m找到函数

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); 
} 

而且是支持的方向返回。