Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4613384
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:32:26+00:00 2026-05-22T01:32:26+00:00

I want to set the Background of HorizontalFieldManager. The sample code I’ve been searching

  • 0

I want to set the Background of HorizontalFieldManager.
The sample code I’ve been searching is setting the background using Gradient for the main screen background.

 //create gradient linear for background
 this.getMainManager().setBackground(BackgroundFactory.createLinearGradientBackground(0x0099CCFF,
                            0x0099CCFF,0x00336699,0x00336699)
                        );

Then I try to use the same pattern to set background to HorizontalFieldManager, since it have this method. But it won’t work. Here’s the code

            HorizontalFieldManager hManager = new HorizontalFieldManager();

    Bitmap bitmapImage = null;

    bitmapImage = Bitmap.getBitmapResource("img/home.png");
    tabHome = new BitmapField(bitmapImage, BitmapField.FOCUSABLE
            | BitmapField.HIGHLIGHT_FOCUS);

    bitmapImage = Bitmap.getBitmapResource("img/in.png");
    tabCheckInOut = new BitmapField(bitmapImage, BitmapField.FOCUSABLE
            | BitmapField.HIGHLIGHT_FOCUS);

    bitmapImage = Bitmap.getBitmapResource("img/barcode.png");
    tabBarcode = new BitmapField(bitmapImage, BitmapField.FOCUSABLE
            | BitmapField.HIGHLIGHT_FOCUS);

    bitmapImage = Bitmap.getBitmapResource("img/options.png");
    tabOptions = new BitmapField(bitmapImage, BitmapField.FOCUSABLE
            | BitmapField.HIGHLIGHT_FOCUS);

    tabHome.setFocusListener(this);
    tabCheckInOut.setFocusListener(this);
    tabBarcode.setFocusListener(this);
    tabOptions.setFocusListener(this);

    Background topBack = BackgroundFactory.createSolidBackground(0x00606A85);
    hManager.setBackground(topBack);

    hManager.add(tabHome);
    hManager.add(tabCheckInOut);
    hManager.add(tabBarcode);
    hManager.add(tabOptions);

    add(hManager);

I’m using HorizontalFieldManager and add 4 BitmapField, then I using BackgroundFactory to create solidBackground, and set it to the manager
but when I run it, the background color does not apply. The gradient example work well. Is there anything that I’m missing? Please help me.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:32:26+00:00Added an answer on May 22, 2026 at 1:32 am

    After doing some deep web search. Here’s the answer guys

    HorizontalFieldManager manager = new HorizontalFieldManager()
    {
        public void paint(Graphics graphics)
        {
            graphics.setBackgroundColor(0x000000FF);//blue
            graphics.clear();
            super.paint(graphics);
        }
    };
    

    UPDATE:
    You must only use Web Color
    such as 0x006699FF should work
    but 0x00606A85 would not work.
    if you want a specific color, i recommend you using bitmap.

    UPDATE:
    Another solution

     HorizontalFieldManager manager = new HorizontalFieldManager(Field.USE_ALL_WIDTH);
     manager.setBackground(BackgroundFactory.BackgroundFactory
                .createSolidBackground(0x00cccccc));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I create one application used form class now its very simple,I want set background
Hello i have the following xml for menu i want to set the background
I want to set an image as the background for my uitableview . This
I'm using [UIColor colorWithPatternImage:] to set the background image for my grouped UITableViewCell. I
I have a image who's width and height i got in Javascript. i want
I use next code. [UIView transitionFromView:viewA toView:viewB duration:1.0 options: UIViewAnimationOptionTransitionFlipFromLeft completion: ^(BOOL inFinished) {
I have created a button in my screen's XML like this: <Button android:text=Lets Get
How can i catch the object is null or not an object. Actually i
Hi I have created a relative layout. and align the imageview to the right
I have a basic html select: <select> <option value=1>Apple</option> <option value=2>Banana</option> <option value=3>Grape</option> </option>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.