So that all view's width and height value are in dp, instead of default unit 'pixel'
In tiapp.xml, add/change
<property name="ti.ui.defaultunit" type="string">dp</property>
Note: default value for this property is 'system', which means 'pixel' on Android, 'dip' on iOS
2. To calculate the screen size, divide screen width and height by density factor:
Screen width:
Ti.Platform.displayCaps.platformWidth / Ti.Platform.displayCaps.logicalDensityFactor
Screen height:
Ti.Platform.displayCaps.platformHeight / Ti.Platform.displayCaps.logicalDensityFactor
沒有留言:
張貼留言