[TIMOB-27239] TextField padding property uses different units between Android and iOS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Reopened |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | ACI Informatica |
Assignee | Eric Merriman |
Created | 2019-06-04T09:22:16.000+0000 |
Updated | 2019-07-12T18:43:32.000+0000 |
Description
*Problem*
Adding the same padding to a TextField on Android and iOS leads to different results.
It seems that Android uses pixels beacuse on phones with different densities you have different sizes of padding using the same digit. Instead iOS uses dp (correctly beacuse default unit in tiapp.xml is dp).
*Test case*
Execute below code
Padding (focus only on left and right beacuse top and bottom aren't working on iOS) is different between Android (smaller) and iOS (bigger).
$.win.open();
<Alloy>
<Window id="win">
<TextField id="field"/>
</Window>
</Alloy>
"#win": {
backgroundColor: 'black'
}
"#field": {
height: Ti.UI.SIZE,
width: Ti.UI.SIZE,
top: 32,
backgroundColor: 'red',
padding: {
top: 32,
bottom: 32,
right: 32,
left: 32,
},
value: 'Test Test Test Test'
}
Attachments
File | Date | Size |
---|---|---|
android.jpg | 2019-06-04T08:55:45.000+0000 | 88793 |
ios.png | 2019-06-04T08:55:44.000+0000 | 19262 |
I think that height and width contrast with padding. Try to use a view as a container for textField and try to remove height and width elements. Regards
[~sdarda] This isn't a duplicate, but a different bug on the same property. The other one is for top and bottom padding not working on iOS; this one is for different measurement units used between Android and iOS (of course can be noticed only on left and right padding as stated in point 2 of the test case). Used the same example code because is very basic and the property is the same.
Hello, This is a valid issue with SDK 8.0.2.GA in iOS simulator and Android emulator. Thanks.