Screen Titles
All screens support the setting of titles which are usually shown at the top of the screen.
Design
![]()
You can design the title of all screen with the default title style:
colors {
fontColor: #222;
fontShadowColor: #eee;
focusedFontColor: #111;
}
title {
padding: 2;
font-face: proportional;
font-size: large;
font-style: bold;
font-color: focusedFontColor;
background {
type: vertical-gradient;
top-color: #fff;
bottom-color: #ccc;
start: 2%;
end: 90%;
}
border: none;
layout: horizontal-center | horizontal-expand;
text-effect: shadow;
text-shadow-color: fontShadowColor;
}
Note that the red status button in the above example is realized with a ScreenInfo element. Other options for embetting information within the title area include to use Item/CustomItem as your title, the usage of before/after attributes or of an image background.
Title specific design attributes:
| CSS Attribute | Default | Values | Applies To | Explanation |
|---|---|---|---|---|
| title-position | top | top, bottom | title style, screen style | Positions the title at either the top or the bottom of the screen. |
| title-style | title | - | screen style | Sets a specific title style for the referenced screen:
.myAlert {
title-style: myAlertTitle;
}
.myAlertTitle {
background-color: red;
}
|
| show-text-in-title | false | false, true | list style | Supresses the original title and uses the text of the currently selected element as the title within a list:
.mainMenuList {
show-text-in-title: true;
}
|
Further design options:
- Common CSS Attributes for specifying margins, layout, colors, before/after images and so on.
- Text Design for specifying fonts and text-effects.
- Backgrounds for designing the background.
- Borders for designing the border.
Configuration
You need to set the fullscreen-mode to either "menu" or "true" when J2ME Polish should render the title, otherwise the native title implementation of your target platform is used. You can set the fullscreen-mode within the <build> element of the <j2mepolish> task of your build.xml script:
<build usePolishGui="true" fullscreen="menu" > (...)
Programming
You can use any GUI item including your own CustomItem as a title by calling UiAccess.setTitle( Screen, Item ).
You can also set a subtitle located under the title by calling
UiAccess.setSubTitle( Screen screen, String subTitle) or UiAccess.setSubTitle( Screen screen, Item subTitle).
You can hide the title as well as the menubar by calling screen.setFullScreenMode( true ); or
UiAccess.setFullScreenMode( Screen, booolean ).