制定不同的屏幕尺寸黑莓应用

制定不同的屏幕尺寸黑莓应用

问题描述:

我开发的JDE 4.5的应用程序。 4.5 OS是由珍珠,曲线和休伦所以我正在开发将支持所有上述设备的应用支持。我现在面临的问题是屏幕尺寸。珍珠的屏幕尺寸为240×260,曲线320×240,休伦湖320×240。

I am developing an application on JDE 4.5. The 4.5 OS is supported by the Pearl, Curve and Huron so the application which I am developing will support all the above devices. The problem which I am facing is screen size. Screen Size of the Pearl is 240 x 260, Curve 320 x 240, Huron 320 x 240.

我现在面临以下问题:


  1. 应该是什么背景图像的尺寸
  2. 我应该如何放置字段(按钮,标签....)?

  1. What should be the dimensions of the background image?
  2. How should i place the fields (button , label....)?

任何一个可以请帮我。

非常感谢

黑莓设备的分辨率大致可划为两种类别:

Blackberry device resolutions can be broadly placed in two categories:


  1. 低分辨率(宽度小于或等于320像素)

  2. 高分辨率(宽度超过320像素)

这个分类方便地让我们只保留两个版本的位图和布局 - 一个用于低分辨率设备,一种针对高清晰度设备。

This categorization conveniently allows us to maintain only two versions of the bitmaps and layouts - one for low-res devices and one for high-res devices.

样code与这些不同类别的屏幕分辨率的处理将是:

Sample code for dealing with these different categories of screen resolution would be:

boolean lowRes = net.rim.device.api.system.Display.getWidth() <= 320;
if (lowRes)
{
    // The device has a low resolution screen size
}
else
{
    // The device has a high resolution screen size
}

来源:针对不同的屏幕尺寸开发应用程序(http://docs.blackberry.com)