Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-13146

iOS: Changing BorderStyle at runtime a few times causes rounded textField background colour to become transparent

    Details

    • Type: Bug
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: Release 3.0.2, Release 3.1.0
    • Fix Version/s: None
    • Component/s: iOS
    • Environment:

      iOS 6, Ti SDK 3.0.2 GA

      Description

      After clicking switchButton several times, the textField's background colour becomes transparent. It should maintain its state.

      Changing the borderStyle of a textfield at runtime seems to change its background color.

      My goal is to have a "disabled look" for a textfield by removing its border at runtime. When setting it to round border again, its background becomes transparent instead of white (as it originally is).

      The following app.js shows the issue

      var win = Titanium.UI.createWindow({  
          backgroundColor:'red',
          layout: 'vertical',
      });
       
       
      var textField = Titanium.UI.createTextField({
        top: '20dp',
        width: '80%',
        value: 'Titanium',
        borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
        touchEnabled: true,
      })
       
      var switchButton = Titanium.UI.createButton({
        top: '10dp',
        width: '80%',
        title: 'Toggle'
      })
       
      switchButton.addEventListener('click', function(){
        if(textField.touchEnabled){
          textField.borderStyle = Ti.UI.INPUT_BORDERSTYLE_NONE;
          textField.touchEnabled = false;
          //textField.backgroundColor = 'transparent'; // try to uncomment to see
        } else {
          textField.borderStyle = Ti.UI.INPUT_BORDERSTYLE_ROUNDED;
          textField.touchEnabled = true;
          //textField.backgroundColor = 'white'; // try to uncomment to see
        }
      });
       
      win.add(textField);
      win.add(switchButton);
      win.open();
      

      When manually changing the backgroundColor to white to circumvent the problem, the corner of the textfield becomes white without respecting the rounded property (see screenshot).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              fstephany Francois Stephany
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-15961
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code