如何在 LWUIT 中获取为 MenuBar 和 TitleBar 保留的高度之外的屏幕高度?
我想获取可以在其上绘制对象的屏幕的高度和宽度。它是除菜单栏(包含命令的页脚)和标题栏之外的空间。
提示:我知道 Display.getInstance().getDisplayHeight()
返回屏幕的高度,但这是针对全屏的。那么我至少如何知道 MenuBar 和 TitleBar 的高度来从这个高度中减去它们呢?
I want to get the height and width of the screen which I could draw objects on. It's the space which is other than the the MenuBar (the footer containing commands) and other than the TitleBar.
TIP: I know that Display.getInstance().getDisplayHeight()
returns the height of the screen but this is for the full sceen. So how could I, at least, know the height of the MenuBar and TitleBar to substract them from this height ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我为有兴趣的人找到了答案:
获取TitleBar的高度:
Form.getTitleComponent().getPreferredH()
获取AddressBar的高度:
Form.getSoftButton(0).getParent().getPreferredH()
所以我的问题的答案是:
I found the answer for those who are interested:
To get the height of TitleBar:
Form.getTitleComponent().getPreferredH()
To get the height of AddressBar:
Form.getSoftButton(0).getParent().getPreferredH()
So the answer of my question is: