2

I am trying to create a tool bar with 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 it doesn't effect the background of toolbarmanager, while setting the background of mainmanager works fine

Stephane Rolland
  • 38,876
  • 35
  • 121
  • 169
Mohamed Magdy
  • 551
  • 2
  • 9
  • 19

2 Answers2

3

I got it , i used call HorizontalFieldManager constructor with USE_ALL_WIDTH parameter

Mohamed Magdy
  • 551
  • 2
  • 9
  • 19
1

hey i know 1 more 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);
 }
}

no add components to this manager

Stephane Rolland
  • 38,876
  • 35
  • 121
  • 169
Swati
  • 2,870
  • 7
  • 45
  • 87