Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的应用程序中,我使用默认文本元素进行文本对齐。有时当应用程序安装在不同的设备上时,文本右对齐而不是左对齐。如何更改默认对齐方式而不为每个文本添加对齐方式?
使用此代码:
if((Display.getWidth()==320) && (Display.getHeight()==240)) { //set the alignment } else if((Display.getWidth()==360) && (Display.getHeight()==480)) { //set alignment }
等等...