2013-03-10 56 views
0

我有一個基本的應用程序使用sencha觸摸,從一個視圖到另一個用戶。當我由於某些原因將模擬器更改爲橫向模式時,它的佈局保持不變,仍然顯示橫幅。我怎樣才能改變這種行爲?sencha觸摸應用程序佈局不會改變爲風景

+0

不知道爲什麼它不會切換,但你可以處理程序附加到ST2的'orientation'事件,看它是否被解僱的。閱讀[在本地應用程序的定位]文檔(http://docs.sencha.com/touch/2-0/#!/guide/native_apis-section-5)。 – jakerella 2013-03-10 17:39:03

回答

0

在口中添加一個orientationChange事件:

initialize: function() { 
    // Add a Listener. Listen for [Viewport ~ Orientation] Change. 
    Ext.Viewport.on('orientationchange', 'handleOrientationChange', this, {buffer: 50 }); 
    this.callParent(arguments); 
}, 
handleOrientationChange: function(){ 
    console.log('handleOrientationChange'); 
    // Execute the code that needs to fire on Orientation Change. 
}