HorizontalFieldManager added to the bottom of the screen (to show the user a cost)

Hello, I am trying to pin a HorizontalFieldManager towards the bottom of the screen and have a VerticalFieldManager scroll over it. I searched and found that I can do this through the substitution of the method sublayout of my screen. Note: I know I could use the setStatus() of a class display method, but I need of this screen to be just a screen and not a screen. Here is a picture of what I'm trying to accomplish:

So the blue VerticalFieldManager should be scrollable to allow the user to select toppings for their food, and the Red HorizontalFieldManager should be set so that the user can always see their total (and continue to the next screen to complete their order)

Here is the code that I have to do:

protected void sublayout(int width, int height) {
        layoutChild(redManager, width, height);
        setPositionChild(redManager, 0, height);
        layoutChild(blueManager, width, height - redManager.getHeight());
        setPositionChild(blueManager, 0, 0);
        setExtent(width, height);
        }

However, I get an error: IllegalArgumentException: field is not a child of this Manager. How I add the fields to the screen is as follows:

public MyScreen extends Screen {
        ...
        public MyScreen() {
            this.add(blueManager);
            this.add(redManager);
        }
}
}

Also, using an AbsoluteFieldManager has also been proven not

Hello

post previous sorry was by mistake... try this.

VerticalFieldManager ScrollingVFM = new VerticalFieldManager() {}
protected void sublayout (int width, int height) {}

Super.sublayout (width, height);
setExtent (Display.getwidth (), Display.getHeight () - bottomHFMHeight);
}
}

Add this to the screen and add your background hfm to screen

Kind regards

pp

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for