[TIMOB-9606] TiAPI: Allow configuration of the default unit (pixels, dpi, etc.)
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-08-24T13:51:09.000+0000 |
Affected Version/s | Release 2.1.0 |
Fix Version/s | Release 2.0.0 |
Components | TiAPI |
Labels | core |
Reporter | Matt Schmulen |
Assignee | Eric Merriman |
Created | 2012-06-18T08:31:41.000+0000 |
Updated | 2017-03-16T21:39:53.000+0000 |
Description
Titanium provides universal unit support by allowing the developer to specify unit types when specifying absolute layout parameters ( ie: width, height, left, etc.).
if the developer specifies a layout parameter without specifying a unit, the system selects the default unit type ( currently pixels ).
The developer must explicitly specify the layout type for unit types that are not the default pixel unit.
example:
width: "123dp"
or
width: "123mm"
Rarely do application developers create applications that mix units. Therefore devleopers must append to every unit specification the unit type if they do not want to use the default pixels.
Causing the following issues:
- reduces the efficiency of the developer,
- increases the probability of user created bugs in the application code.
- increases the size of the executing code,
- decreases the performance do to the increased code execution size.
Adding a default unit override would resolve these issues allowing the developer to set the number and omit the unit type.
Titanium has supported a
ti.ui.defaultunit
property for a long, long time. It's been in thetiapp.xml
for all new projects since Titanium SDK 2.0.0.Closing ticket as fixed.