Tuesday, July 21, 2009

Change Main Screen Background in Blackberry

In here i tried several methods to do that. All methods give me some out put but not perfect. most of examples gives the out put but also gives ugly scoll bar. I used folloeing coding to set main screen backgroung color with out the scoll bar in component pack 4.5.

public class frmLogin extends MainScreen {

VerticalFieldManager vmain;
public frmLogin() 
{
       super(NO_VERTICAL_SCROLL);
      vmain = new VerticalFieldManager(USE_ALL_HEIGHT |USE_ALL_WIDTH)
     {
 protected void paint(net.rim.device.api.ui.Graphics graphics) 
        {
     graphics.setBackgroundColor(0xe6e7e8);  // 0xRRGGBB or Color.Blue
         graphics.clear();
 super.paint(graphics);
        } 
     };
     
     // Add other controlers to vmain
     
     add(vmain);
}
Post a Comment