我感觉它与图像路径有关,它没有检测到图像。我是黑莓开发的新手。
应用程序运行但图像没有显示。也许图像没有正确定位?
public final class Welcome extends MainScreen
{
/**
* Creates a new Welcome object
*/
public Welcome()
{
// Set the displayed title of the screen
setTitle("Select a brand");
Bitmap bitmapImage = Bitmap.getBitmapResource("/BrowserBlackberry/res/img/Celsian.jpg");
BitmapField fieldDemo = new BitmapField(bitmapImage);
fieldDemo.setBorder(150,getBorder(20));
fieldDemo.getBackground(Background.POSITION_X_CENTER);
add(fieldDemo);
}
}
答案 0 :(得分:2)
试试这个
public Welcome()
{
// Set the displayed title of the screen
setTitle("Select a brand");
Bitmap bitmapImage = Bitmap.getBitmapResource("Celsian.jpg");
BitmapField fieldDemo = new BitmapField(bitmapImage);
add(fieldDemo);
}