Search code examples
blackberryblackberry-stormblackberry-eclipse-plugin

aligning HorizontalFieldManager to the bottom of the Screen


i am having 4 ButtonField and i want to align all the buttons horizontally. for that i am using HorizontalFieldManager and assigning Field.FIELD_BOTTOM for putting all the button field to the button of the screen. but its not working fine. i don't no what is wrong with it


Solution

  • Try to set USE_ALL_HEIGHT style in manager constructor:

    class MenuScreen extends MainScreen {        
        public MenuScreen() {
            super(DEFAULT_CLOSE);
            HorizontalFieldManager manager = 
                new HorizontalFieldManager(FIELD_BOTTOM|USE_ALL_HEIGHT);    
            add(manager);
            manager.add(new ButtonField("1", FIELD_BOTTOM));
            manager.add(new ButtonField("2", FIELD_BOTTOM));
            manager.add(new ButtonField("3", FIELD_BOTTOM));
            manager.add(new ButtonField("4", FIELD_BOTTOM));
        }
    }
    

    alt text http://img412.imageshack.us/img412/8776/managerg.jpg