Developing for multiple screen sizes on BlackBerry

非 Y 不嫁゛ 提交于 2019-11-30 15:33:18

Points are density independent pixels (to a good degree of accuracy).

For BlackBerry, the most relevant class is net.rim.device.api.ui.Ui which defines a UNITS_pt constant (and a UNITS_px constant), a convertSize method to convert between points and pixels (since operations on Graphics take pixels instead of points).

A useful methodology for BlackBerry apps is to take everything in relation to your font sizes, which you define in points - there's a version of net.rim.device.api.ui.Font.derive that takes a units parameter and makes it easy to get fonts with a particular point size.

Of course, you can't take anything for granted - defining things in points will make things easier, but with BlackBerry you deal with lots of different pixel densities and aspect ratios so test thoroughly, at least on the simulators.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!