如何根据屏幕(或显示器)尺寸调整组件的尺寸?
我在另一部手机(htc
手机)上测试了我的应用程序,它的屏幕尺寸非常大。所以当我看到组件的排列时我非常惊讶!这是从另一部手机的摄像头捕获的屏幕图像:
那么如何使组件成为根据任何设备的屏幕显示尺寸调整尺寸和放置位置?
I tested my application in another mobile phone , a htc
mobile phone , and it has a very large screen size. So I was very surprised when I saw the arrangement of the components ! Here is the captured image of the screen from the camera of another phone :
So how to make the components be sized and placed well according to the screen display size of any device ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AFAIF LWUIT 组件根据分辨率自动调整大小。我认为您正在为这些组件使用
setMargin
或setPadding
。所以你需要根据分辨率来处理它们。获取移动设备的分辨率并更改组件边距和填充。使用此代码获取分辨率,AFAIF LWUIT components automatically resized based on resolution. I think you are using
setMargin
orsetPadding
for those components. So you need to handle them based on resolution. Get the resolution for the mobile and change the component margin and padding. use this code for get resolutions,