Aligning the Items with Layout
You can align your items with the layout attribute. The layout attribute defines how the affected item should be aligned and laid out. Possible layout values are, for example, left, right, and center. All layout values of the MIDP 2.0 standard can be used, as shown in Table 12-9. If you want to use the complete available width and center the item horizontally, you can specify layout: center | expand;, for example. You can use several signs for separating the layout values: use the || , |, or, or and operator.
Table 12-9. Available Layout Values
Layout
Alternative Names
Explanation left right center expand shrink top bottom vcenter vexpand vshrink newline-after newline-before plain horizontal-center, hcenter horizontal-expand,hexpand horizontal-shrink, hshrink vertical-center vertical-expand vertical-shrink default,none
The affected items should be left-aligned.
The affected items should be right-aligned.
The affected items should be centered horizontally.
The affected items should use the whole available width (that is, should fill the complete row).
The affected items should use the minimum width possible.
The affected items should be top-aligned.
The affected items should be bottom-aligned.
The affected items should be centered vertically.
The affected items should use the whole available height (that is, should fill the complete column).
The affected items should use the minimum height possible.
Items following an item with a newline-after layout should be placed on the next line. Only relevant when you use the midp2 view type.
The affected items should always start on a new line (when there are any items in front of it). Only relevant when you use the midp2 view type.
No specific layout should be used; instead, the default behavior should be used. Such a layout does not need to be defined explicitly, but it can be useful to overwrite a basic setting when you extend another style.
Post a comment