我将两个BitmapField和两个LabelField添加到垂直管理器中,但第一个BitmapField不可见。当我不添加任何两个字段时,第一个BitmapField变得可见。我错了什么代码如下
gridbackManager=new VerticalFieldManager(VerticalFieldManager.NO_HORIZONTAL_SCROLL|VerticalFieldManager.VERTICAL_SCROLL){
protected void paintBackground(Graphics graphics)
{
int c = graphics.getColor();
//graphics.setColor(Color.WHITESMOKE);
graphics.drawBitmap(0, 0, backbitmap.getWidth(), backbitmap.getHeight(),backbitmap,0,0);
//graphics.setColor(c);
super.paintBackground(graphics);
}
protected void sublayout( int maxWidth, int maxHeight )
{
int width = backbitmap.getWidth();
int height = backbitmap.getHeight();
//super.sublayout( width, height);
Field f = getField(0);
setPositionChild(f,10, 0);
layoutChild(f,maxWidth, maxHeight);
f = getField(1);
setPositionChild(f,50, 0);
layoutChild(f,maxWidth, maxHeight);
f = getField(2);
setPositionChild(f,50, 20);
layoutChild(f,maxWidth, maxHeight);
f = getField(3);
setPositionChild(f,215, 10);
layoutChild(f,maxWidth, maxHeight);
setExtent( maxWidth, 61);
}
};
gridbackManager.add(bitmap);
gridbackManager.add(task);
gridbackManager.add(task2);
gridbackManager.add(bitmapdownload);