Using a Template in the Mobile Application User Interface
After you create a template to customize a user interface object, you can use the object in the user interface of your mobile application.
The following procedure describe how to use a template by using the
TemplateReference object. You can also use templates to customize a ListView. For more information, see
Programmatically Populating a
ListView and
Using a Content Provider to Populate a
ListView.
To use a template in a mobile application user interface
2. In the Model section of the Outline Editor, expand the UserInterface part of the outline so that you view the location where you want to add the template.
3. Right-click the node in which you want to use the template and select New Child > TemplateReference.
Note: | If TemplateReference is not listed in the right-click menu, it is not valid where you want to use the template. |
4. Select the TemplateReference node.
5. In the Properties section of the Outline Editor, specify the following properties:
For this property... | Specify... |
Name | Name for your own reference purpose. This name does not appear in the application’s user interface. |
Template | Template that you want to use. The list includes the templates that you have added to your project. |
Tip: | To update the Java classes that Mobile Development generates for the project so that your changes are represented in the generated sources, save the project and regenerate sources. For instructions, see Generating Sources for a Mobile
Project. |
Related Topics