BlackBerry - how to change manager background image?

I am trying to create a toolbar with a background color different from the screen background, I am using the following code

getMainManager().add(mToolbarManager = new HorizontalFieldManager()); mToolbarManager.add(mBtn = new BitmapButtonField(mBmpNor, mBmpFoc, mBmpAct)); Background bg = BackgroundFactory.createSolidBackground(Color.BLACK); mToolbarManager.setBackground(bg); mToolbarManager.add(mBtn = new BitmapButtonField(mBmpNor, mBmpFoc, mBmpAct));

but this does not affect the background of the toolbarmanager, while the background of the mainmanager works fine

+2


a source to share


2 answers


I got it, I used HorizontalFieldManager constructor with USE_ALL_WIDTH parameter



+3


a source


Hey, I know another way that I used:

class Mymanager extends Manager
{
final Bitmap back = Bitmap.getBitmapResource("back.png");
Mymanager ()
{
 super(Manager.NO_VERTICAL_SCROLL);
}
public void paint(Graphics g)
 {
  g.drawBitmap(0,0,back.getWidth(),back.getHeight,back,0,0);
 }
}

      



do not add components to this manager

+1


a source







All Articles