Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24153] iOS: Add parity for Ti.UI.TextField.padding

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-11-18T04:20:30.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 6.1.0
ComponentsiOS
Labelsqe-6.1.0
ReporterHans Knöchel
AssigneeHans Knöchel
Created2016-11-16T19:21:28.000+0000
Updated2016-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.

Comments

  1. Hans Knöchel 2016-11-16

    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();
       
  2. Harry Bryant 2016-11-18

    Verified fixed, padding property is now supported with iOS, and paddingLeft / paddingRight properties 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.*

JSON Source