0

我感觉它与图像路径有关,它没有检测到图像。我是黑莓开发的新手。

应用程序运行,但图像不显示。也许图像没有正确定位?

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);
    }
}
4

1 回答 1

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);

}
于 2013-09-06T13:06:47.103 回答