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();
});
再現手順は次のとおりです。
- タブ 2 に切り替えてから、横向きモードに入ります (アラートが表示されます)。
- タブ 1 に戻り、電話を縦向きモードに回転します (アラートは表示されません)。
- イベントは発生しません。(その後のイベントは通常通り発生します (アラートが表示されます))
誰でも回避策について考えがありますか? ビューを変更する必要があるため、それが必要ですonorientationchange
。Titanium Appcelerator 1.2.2、モバイル バージョン 1.6、Api 2.2 を使用しています