[TIMOB-24153] iOS: Add parity for Ti.UI.TextField.padding
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2016-11-18T04:20:30.000+0000 |
| Affected Version/s | Release 6.0.0 |
| Fix Version/s | Release 6.1.0 |
| Components | iOS |
| Labels | qe-6.1.0 |
| Reporter | Hans Knöchel |
| Assignee | Hans Knöchel |
| Created | 2016-11-16T19:21:28.000+0000 |
| Updated | 2016-11-18T18:29:14.000+0000 |
Description
We implemented the
padding property in TIMOB-16512 for Android, but iOS still uses paddingLeft and paddingRight. We should update them for a better parity.
PR: https://github.com/appcelerator/titanium_mobile/pull/8615 Unit-Test: https://github.com/appcelerator/titanium-mobile-mocha-suite/pull/13 Test-Case:
var win = Ti.UI.createWindow({ layout: "vertical", backgroundColor: "#fff" }); var t1 = Ti.UI.createTextField({ value: "lllllllllmmmmmmmmmmmmmmlllllllllll", // This will throw depreaction warnings paddingLeft: 20, paddingRight: 0, width: 100, height: Ti.UI.SIZE, borderColor: "#000", color: "#000", borderWidth: 1, top: 10 }); var t2 = Ti.UI.createTextField({ value: "lllllllllmmmmmmmmmmmmmmlllllllllll", // This is the new way to do it - with parity padding: { right: 20, left: 0 }, width: 100, height: Ti.UI.SIZE, borderColor: "#000", color: "#000", borderWidth: 1, top: 10 }); var t3 = Ti.UI.createTextField({ value: "lllllllllmmmmmmmmmmmmmmlllllllllll", padding: { left: 20, right: 20 }, width: 100, height: Ti.UI.SIZE, borderColor: "#000", color: "#000", borderWidth: 1, top: 10 }); var t4 = Ti.UI.createTextField({ value: "lllllllllmmmmmmmmmmmmmmlllllllllll", padding: { left: 0, right: 0 }, width: 100, height: 100, borderColor: "#000", color: "#000", borderWidth: 1, top: 10 }); win.add(t1); win.add(t2); win.add(t3); win.add(t4); win.open();Verified fixed,
paddingproperty is now supported with iOS, andpaddingLeft/paddingRightproperties return Deprecated Warnings when used. Tested On: iPhone 6 Plus 10.1.1 Device & Simulator iPhone 5S 9.3.5 Device Mac OS Sierra (10.12.1) Ti SDK: 6.1.0.v20161118100640 Appc Studio: 4.8.0.201611121409 Appc NPM: 4.2.8 App CLI: 6.1.0-14 Xcode 8.1 Node v4.4.7 *Closing ticket.*