Add text to the app by enhancing the layout_phone.xml:
<?xml version="1.0" encoding="UTF-8"?> <MAF xmlns="http://schemas.sap.com/maf/2012/cfg"> <!-- Define a "tile" - it translates to UIViewController --> <Tile tileId="First Extensible Screen"> <!-- This is our root view --> <P pid="isRoot" value="true" /> <!-- Define the layout container. All UI elements included in a layout container will be auto-arranged --> <LinearContainer layout="vertical"> <!-- Define our label --> <UIElement type="label"> <!-- Assign the text to be displayed --> <P pid="text" value="Hello World! This is Extensibility!"></P> <!-- Default styling is automatically applied (see MAFUIComponents.bundle -> SAPDefaultStyle.xml) --> </UIElement> </LinearContainer> </Tile> </MAF>This code first adds a linear container, which arranges the content to be shown based on several criteria. It does not specify additional layout parameters for brevity, therefore the defaults apply. It then adds a label type UI element, a TextView, and assigns a static text to it. You can localize texts, but doing so is outside the scope of this sample.
<P pid="halign" value="center"></P> <P pid="margin_top" value="20pt"></P>
<P pid="valign" value="center"></P>There are several settings allowing you to fine-tune the position and dimensions of the tiles and UI elements. See the metadata XML for all possible values.