2
我只是性学习的如何将黑莓程序,并试图在屏幕上显示位图的位图,这里是代码:试图借鉴黑莓
public MyScreen()
{
// Set the displayed title of the screen
setTitle("MyTitle2");
LabelField lb = new LabelField("hello ted2");
add(lb);
Bitmap logoBitmap = Bitmap.getBitmapResource("res/icon2.png");
BitmapField fd= new BitmapField(logoBitmap, Field.FIELD_HCENTER);
add(fd);
}
标签被绘制而不是位图。
嗨,谢谢你回答我的quastion,但是......它仍然不起作用。 – 2011-05-07 12:04:14
确保您的PNG文件路径正确。如果不是,我认为'getBitmapResource'只返回'null',所以不会抛出异常。 – MusiGenesis 2011-05-07 13:32:55