Help Center

Local Navigation

Create a layout manager

  1. Import the following classes:
    • net.rim.device.api.ui.Screen
    • net.rim.device.api.ui.Manager
    • net.rim.device.api.ui.container.VerticalFieldManager
    • net.rim.device.api.ui.component.BitmapField
    • net.rim.device.api.ui.container.HorizontalFieldManager
    • net.rim.device.api.ui.container.FlowFieldManager
    • net.rim.device.api.ui.container.DialogFieldManager
    • net.rim.device.api.ui.container.MainScreen
  2. Create an instance of the appropriate Manager subclass.
  3. Add UI components to the layout manager.
  4. Add the layout manager to the screen. In the following code sample, we create a VerticalFieldManager to organize fields from top to bottom in a single column. We then add several BitmapFields to the VerticalFieldManager. We invoke MainScreen.add() to add the VerticalFieldManager to the MainScreen of the application.
    VerticalFieldManager vfm = new VerticalFieldManager(Manager.VERTICAL_SCROLL);
    vfm.add(bitmapField);
    vfm.add(bitmapField2);
    ...
    mainScreen.add(vfm)
    

Index


Was this information helpful? Send us your comments.