0

orientationchangeチタン製のアクセラレータに問題があります。タブ間を移動する場合orientationchange、縦向きと横向きを切り替えるとイベントが発生しません。

これが私のコードです

Titanium.Gesture.addEventListener('orientationchange', function(e){

    var alertDialog = Ti.UI.createAlertDialog({
        title: "Alert",
        message: "Orientation is "+  e.orientation,
        buttonNames: ['OK'],
        cancel:0
    });
    alertDialog.show();

});

再現手順は次のとおりです。

  1. タブ 2 に切り替えてから、横向きモードに入ります (アラートが表示されます)。
  2. タブ 1 に戻り、電話を縦向きモードに回転します (アラートは表示されません)。
  3. イベントは発生しません。(その後のイベントは通常通り発生します (アラートが表示されます))

誰でも回避策について考えがありますか? ビューを変更する必要があるため、それが必要ですonorientationchange。Titanium Appcelerator 1.2.2、モバイル バージョン 1.6、Api 2.2 を使用しています

4

2 に答える 2

0
Ti.Gesture.addEventListener('orientationchange', function(e){

var alertDialog = Ti.UI.createAlertDialog({ 
    title: "Alert", message: "Orientation is "+ e.orientation, buttonNames: ['OK'], cancel:0 }); alertDialog.show();

});
于 2012-07-25T10:17:39.790 に答える
0

気にしない

編集:回避策を見つけましたhttp://developer.appcelerator.com/question/74781/orientationchange-is-never-fired

于 2011-03-28T16:24:42.840 に答える