0

在我的应用程序中,我使用默认文本元素进行文本对齐。有时当应用程序安装在不同的设备上时,文本右对齐而不是左对齐。如何更改默认对齐方式而不为每个文本添加对齐方式?

4

1 回答 1

0

使用此代码:

if((Display.getWidth()==320) && (Display.getHeight()==240))
{
    //set the alignment
}
else if((Display.getWidth()==360) && (Display.getHeight()==480))
{
    //set alignment
}

等等...

于 2011-11-03T14:32:34.860 回答