我有一种感觉,它与图像路径有关,它没有检测到图像。我是黑莓开发的新手。
应用程序运行但图像不显示。也许图像位置不正确?
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);
}
}
最佳答案
试试这个
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);
}
关于java - 黑莓应用程序 - 位图图片未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18655231/