Skip to end of metadata
Go to start of metadata

Demonstrates how to conditionally apply TSS styles or include XML markup based on the form factor of the target device. Each XML element, or TSS style, can be assigned a formFactor attribute that can take a value of either "handheld" or "tablet".

App folder location

Icon

alloy/test/apps/advanced/form_factor


 

On handhelds, the main Label text is set to "I'm a handheld!" and to "I'm a tablet!" on tablets. The platformLabel Label displays the platform as well as form factor.

app/views/index.xml

The backgroundColor attribute of all View objects on handhelds is set to blue, and to red on all tablets.

app/styles/index.tss

See also