We undertake the previous article "ui api display UI components". This article describes how to manage UI components.
Manage UI Components
Manage Layout
Use the BlackBerry API layout manager to arrange on-screen components.
The following four classes extend the Manager class to provide a predefined layout Manager:
◆ VerticalFieldManager
◆ HorizontalFieldManager
◆ FlowFieldManager
◆ DialogFieldManager
By default, both MainScreen and FullScreen use a VerticalFieldManager. Only defining a layout manager instance for these classes provides different la S.
Note: to create a custom layout Manager, expand the Manager.
Define the layout manager for a specified Screen instance and complete the following operations:
◆ Instantiate an appropriate Manager subclass.
◆ Add the UI component to the layout manager.
◆ Add the layout manager to the screen.
The Manager class defines constants of multiple system styles that define actions such as scrolling and alignment. Use these styles as parameters when creating a layout manager.
Vertical organization field
VerticalFieldManager vertically organizes fields. All fields start on a new line. The Manager. VERTICAL_SCROLL parameter is provided for vertical scrolling.
By default, BitmapField objects are left aligned in VerticalFieldManager.
Horizontal organization field
HorizonFieldManager horizontal organization field. Provides the Manager. HORIZONTAL_SCROLL style for horizontal scrolling. If the HORIZONTAL_SCROLL parameter is not included, fields can be horizontally arranged by themselves, which may exceed the screen width, but the user cannot scroll beyond the content on the right of the screen.
The BlackBerry device does not display a horizontal scroll indicator or scroll bar.
Horizontal and vertical organization Field
FlowFieldManager organizes fields horizontally and then vertically. Organize fields horizontally until there is not enough space for another Field, and then arrange them horizontally on the next line. Home Screen is an example of FlowFieldManager.
Specify the layout of a PopupScreen
DialogFieldManager specifies the layout of the PopupScreen object. It manages an icon, a message, and a customized field Layout. The icons and messages are close to each other at the top of the layout, and the Custom field appears at the bottom of the message. This layout is the standard layout of PopupScreen objects. To create a custom dialog box, expand DialogFieldManager.
By default, BitmapField objects are left aligned in VerticalFieldManager.
Horizontal organization field
HorizonFieldManager horizontal organization field. Provides the Manager. HORIZONTAL_SCROLL style for horizontal scrolling. If the HORIZONTAL_SCROLL parameter is not included, fields can be horizontally arranged by themselves, which may exceed the screen width, but the user cannot scroll beyond the content on the right of the screen. The BlackBerry device does not display a horizontal scroll indicator or scroll bar.
Horizontal and vertical organization Field
FlowFieldManager organizes fields horizontally and then vertically. Organize fields horizontally until there is not enough space for another Field, and then arrange them horizontally on the next line. Home Screen is an example of FlowFieldManager.
Specify the layout of a PopupScreen
DialogFieldManager specifies the layout of the PopupScreen object. It manages an icon, a message, and a customized field Layout. The icons and messages are close to each other at the top of the layout, and the Custom field appears at the bottom of the message. This layout is the standard layout of PopupScreen objects. To create a custom dialog box, expand DialogFieldManager.