How to Apply the J2ME Polish GUI for Existing Applications

-------------------page 203--------------------------------
|How to Apply the J2ME Polish GUI for Existing Applications |
 -----------------------------------------------------------
If an existing application should be “polished up” you should insert #style preprocessing directives within the application to allow a fine grained design.

//#style mainScreen
List mainScreen = new List( "Main Menu", List.IMPLICIT );
//#style mainScreenItem
mainScreen.append( "Start Game", null );

You then need to use static styles in the “polish.css” file.
Static styles can have almost any alphanumerical name and need to start with a dot:

.mainScreen {
padding: 5;
background-color: yellow;
columns: 2;
columns-width: 40, 100;
}

In the last step you should refine your designs by adjusting them for different handsets. If you want to make adjustments for the SonyEricsson P900 for example, you need to create the file “resources/SonyEricsson/P900/polish.css”. In this file you can change any settings which you have done in the basic “resources/polish.css” file.
Remember that you only need to specify attributes which are different, this makes subsequent changes easier.

Find more information on designing for specific devices on page 112.

你可能感兴趣的:(css,UP)