Developing for multiple screen sizes on BlackBerry

前端 未结 1 852
遥遥无期
遥遥无期 2021-01-03 07:42

Android and iOS have a concept of a \"density independent pixel\" so your layouts look the same on devices with different densities and screen sizes.

Up until now I\

相关标签:
1条回答
  • 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.

    0 讨论(0)
提交回复
热议问题