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 9198827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:22:48+00:00 2026-06-17T22:22:48+00:00

I have a background image, and overlay 2 LabelFields, a BasicEditField, and a ButtonField

  • 0

I have a background image, and overlay 2 LabelFields, a BasicEditField, and a ButtonField overlayed on one screen. My issue is that my background image cuts off after the bottom of the button, instead of filling the screen completely. (I removed superfluous code for ease of reading)

    VerticalFieldManager bgManager = new VerticalFieldManager(Manager.USE_ALL_WIDTH | 
                                                              Manager.NO_VERTICAL_SCROLL | 
                                                              Manager.NO_VERTICAL_SCROLLBAR) {

        //Override the paint method to draw the background image.
        public void paint(Graphics graphics)
        {
            //Draw the background image and then call super.paint
            //to paint the rest of the screen.
            graphics.drawBitmap(0, 0, Display.getWidth(), Display.getHeight(), backgroundBitmap, 0, 0);
            super.paint(graphics);
        }
    };
    this.add(bgManager);

    LabelField header = new LabelField("", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER);
    header.setText("Search by Drug Name");
    bgManager.add(header);

    LabelField subtitle = new LabelField("", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER);
    subtitle.setText("(brand name or generic)");
    bgManager.add(subtitle);

    HorizontalFieldManager hfm = new HorizontalFieldManager();

    final BasicEditField edit = new BasicEditField("", "", 50, EditField.EDITABLE | BasicEditField.NO_NEWLINE) {
        //code to make background of text box white
        }
    };
    hfm.add(edit);

    ButtonField search = new ButtonField("Search");
    search.setChangeListener(new FieldChangeListener() {

        public void fieldChanged(Field field, int context) {
            //do something
        }
    });

My background image fills the screen completely if I add Manager.USE_ALL_HEIGHT to bgManager, but then my entire screen becomes scrollable infinitely. Without Manager.USE_ALL_HEIGHT, my screen is not scrollable at all (correct), but the background image cuts off at the end of the content.

How can I build this screen so it is not scrollable and has a background image that takes up the entire visible screen?

Here is what it looks like wrong:

enter image description here

Here is what it looks like correct (but scrolls incorrectly):

enter image description here

Here is the background image I am using:

enter image description here

  • 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-06-17T22:22:49+00:00Added an answer on June 17, 2026 at 10:22 pm

    I believe that the easiest way to change your code is to in fact use the USE_ALL_HEIGHT flag.

      VerticalFieldManager bgManager =
        new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | 
                                 Manager.NO_VERTICAL_SCROLLBAR | 
                                 Manager.USE_ALL_WIDTH | 
                                 Manager.USE_ALL_HEIGHT) {
    

    Which will fill your screen with the background image.

    You don’t show this code, but I’m guessing the problem is not that bgManager is actually allowing scrolling, but that the Screen that it’s in is allowing vertical scrolling. So, make sure the container you put your code in disables scrolling. Something like this:

    public class BgCropScreen extends MainScreen {
    
       public BgCropScreen() {
          super(MainScreen.NO_VERTICAL_SCROLL);  // <<<<<< THIS IS THE CRITICAL LINE !!!!!!
    
          VerticalFieldManager bgManager = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR | Manager.USE_ALL_WIDTH | Manager.USE_ALL_HEIGHT) {
             // to draw the background image.
             public void paint(Graphics graphics) {
                graphics.drawBitmap(0, 0, Display.getWidth(), Display.getHeight(), backgroundBitmap, 0, 0);
                super.paint(graphics);
             }                
          };
          this.add(bgManager);
    

    Here is the documentation for doing this. It points out that in newer versions of the OS, it’s probably easier to use the BackgroundFactory methods for creating backgrounds, using Bitmaps, gradients, colors, etc. Just another option, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app have a background image that fills the screen. I'd like to display
Ok so I have a Background background-image: url('images/body.png'); now I want to overlay a
I have a tiling background image, but I want to overlay another tiling image
I have this background image that is 175x175 but I am trying to make
I have a background image that is 1024 x 1024 pixels; the reason for
I have a big image that has to go in the background. Say the
I have a div that shows an image: <div id=player style=display:block;width:320px;height:240px;background-image:url(../../../images/video.JPG)></div> I overlay a
I have an image with a transparent background which I would like to overlay
I have a div that has an image as background, with the position for
I am trying to overlay a div that has a background image in it

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.