Java 背景图像在黑莓中垂直滚动?
垂直滚动后如何保留背景图像 现在,我正在使图像适合设备的高度和宽度,但当我向下滚动时,它将显示白色背景 这是我的密码Java 背景图像在黑莓中垂直滚动?,java,blackberry,background,Java,Blackberry,Background,垂直滚动后如何保留背景图像 现在,我正在使图像适合设备的高度和宽度,但当我向下滚动时,它将显示白色背景 这是我的密码 BitmapField _bitmap ; private int phoneWidth = Display.getWidth(); private int cellHeight = Display.getHeight(); public MyScreen(){ super(Manager.USE_ALL_WIDTH | Manager.VERTICAL_SC
BitmapField _bitmap ;
private int phoneWidth = Display.getWidth();
private int cellHeight = Display.getHeight();
public MyScreen(){
super(Manager.USE_ALL_WIDTH | Manager.VERTICAL_SCROLL);
final Bitmap background = Bitmap.getBitmapResource("black.jpg");
VerticalFieldManager vfm = new VerticalFieldManager(USE_ALL_HEIGHT | USE_ALL_WIDTH) {
public void paint(Graphics g) {
Bitmap scaled = new Bitmap(phoneWidth, cellHeight);
background.scaleInto(scaled, Bitmap.SCALE_TO_FIT);
g.drawBitmap(0, 0, phoneWidth, cellHeight,
scaled, 0, 0);
super.paint(g);
}
};
add(vfm);
}
我正在用模拟器Blackberry 9900进行测试。要么使用大图像,要么使用背景色。你的背景图像应该在滚动时重复,还是应该填满屏幕,但永远不要移动?