Time for action - making DIPs the default unit for your app
Open
tiapp.xml
.Look for the highlighted line and ensure the property is
dp
as shown below. If the line does not exist, add it:<analytics>true</analytics> <property name="ti.ui.defaultunit" type="string">dp</property>
Run the app!
What just happened?
You have now set the default unit for your app to be DIPs. Unless you override this by specifying a different measure for an item on your layout, DIPs will be used on all platforms. The following screenshot shows the same app when run on an iPhone. Notice that the label takes up roughly the same amount of horizontal width as the Android screenshots, where DIPs was the unit of measurement.
What about percentages?
Like DIPs, percentages also offer relative positioning to the constraints of the device's display that work across platforms and devices. It's very useful for laying out views on a window.
The disadvantage of percentages is that they cannot be specified as...