2012-02-06 50 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); 
} 

而且是支持的方向返回。