0

I am trying to build a screen in BlackBerry. In which there should be a second title bar just below the original title bar. Also the second title bar should be fixed and it should not be scrolled with vertical scroll.

Need some advice on this issue.

Rupak
  • 3,674
  • 15
  • 23
  • Make a HorizontalFieldManager with flag no_verticalscroll and no Horizontal scroll. And add the contents to it .... and add this hfm just below the title bar – BBdev Jun 07 '12 at 10:05

1 Answers1

2

You can add the second title and the original title bar on a VerticalFieldManager. Then just set that VerticalFieldManager as title, as it's possible to set any Field, Manager instance as title.

Check public void setTitle(Field title) and following example.

public class DemoScreen extends MainScreen {
    public DemoScreen() {
        super();

        // Prepare a Custom Title
        long style = NO_VERTICAL_SCROLL | NO_VERTICAL_SCROLLBAR | USE_ALL_WIDTH;
        VerticalFieldManager myTitle = new VerticalFieldManager(style);

        // Set background color.
        myTitle.setBackground(BackgroundFactory.createSolidBackground(Color.GRAY));

        // Add any numbers/types of field
        myTitle.add(new LabelField("First line."));
        myTitle.add(new LabelField("The second line."));

        // Set the Title
        setTitle(myTitle);
    }
}
Rupak
  • 3,674
  • 15
  • 23