不会发生Titanium Appcelerator方向更改

时间:2011-03-28 16:19:12

标签: android appcelerator orientation-changes

我在钛appcelerator中遇到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. 事件未发生。 (后续事件像往常一样点火(出现警报))
  4. 任何人都有解决方法吗? 我需要这个,因为我必须更改视图onorientationchange。 我正在使用Titanium Appcelerator 1.2.2,移动版1.6,Api 2.2

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分: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();

});