当用户想要改变手机方向时,我的应用显示错误的UI.Android

When user want to change orientation of phone, my application show incorrect UI. Android

本文关键字:显示 应用 我的 错误 Android UI 用户 改变 方向 手机      更新时间:2023-09-26

当用户想要改变手机方向时,我的应用显示错误的UI

手机操作系统:Android Titanium SDK: 3.0.2.GA

我的视频bug: http://www.youtube.com/watch?v=S0Yi-6ZKDcw

此处代码:http://pastebin.com/qRWmGHrk

这段代码告诉应用程序从顶部向下150dp开始,所以在横向方向上,它会把它放在比你想要的低的位置。为方向变化设置一个侦听器,并减少该数量或将其整体减少到在两个方向上都有效的东西。

var viewLoginForm = Ti.UI.createView({
        backgroundColor:'#ecf0f1',
        width:'290dp',
        top:'150dp', // <===== location to start drawing the view
        height:'250dp',
        borderRadius:6
    });