Thursday, November 12, 2009

Change the background color in Blackberry Fields

There are four basic background available in blackberry.

    • SolidBackground
    • SolidBackgroundwithTranparency
    • GradientBackground
    • BitmapBackground
// Solid Background
Background b=BackgroundFactory.createSolidBackground(Color.ANTIQUEWHITE);
setBackground(b);
 
// Solid Background with Transperancy                                       //Alpha
Background b=BackgroundFactory.createSolidTransparentBackground(Color.AZURE,180);
setBackground(b);
 
// Gradient Background
Background b = BackgroundFactory.createLinearGradientBackground(
Color.AZURE,Color.BISQUE,Color.AZURE, Color.BISQUE);
setBackground(b);
 
// Bitmap Background
Background b = BackgroundFactory.createBitmapBackground(yourImage, 0, 0,0);
setBackground(b);
Post a Comment