Defining the Extensibility Metadata XML
The Extensibility Framework relies on metadata stored in an XML file to build its UIs and perform data bindings at runtime.
The XML file must be named according to the app type, either layout_phone.xml or layout_tablet.xml. To build a universal app that runs on both iPhone and iPad requires two separate XML files, named accordingly. However, the tutorial builds an iPhone app, so you need only define layout_phone.xml.
- Add a new file to your project by clicking the Empty
- Name the file layout_phone.xml and click Create.
- You can manually edit the layout XML file to create a simple UI containing a
UILabel. For more details on the layout XML see The Extensibility Layout
- To make it a valid MAF Extensibility layout XML, add these lines to the
<?xml version="1.0" encoding="UTF-8"?> <MAF xmlns="http://schemas.sap.com/maf/2012/cfg"> <!-- Add Content here --> </MAF>
- Replace the Xcode-generated root view controller with your own:
<?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"/> </Tile> </MAF>
- To make it a valid MAF Extensibility layout XML, add these lines to the XML: