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

Android: Label highlightedColor property does not work with TableViewRow

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: Release 8.2.1, Release 8.3.0
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Titanium SDK: 8.3.0
      Emulators: Pixel 3 (API 29), iPhone 11 Pro (13.1), Nexus 4 (API 23)
      Devices: Pixel 3a (API 29), iPhone 6 (iOS 12)

      Description

      When using a Label inside a TableViewRow, the highlightedColor property does not work on Android. It works fine on iOS.

      Test Case
      1. Create a new classic app
      2. Copy and paste the code below into your app.js
      3. Run the app on iOS and Android (any recent SDK version)
      4. Long press any row on both platforms. You can see the text colour changes to blue on iOS.

      Code

      var win = Ti.UI.createWindow({
      	backgroundColor: Ti.Platform.osname === 'android' ? 'gray' : 'white',
      	title: "TIMOB-27637"
      });
      var navWin = Titanium.UI.createNavigationWindow({
         window: win
      });
       
      var data = [ "Apples", "Bananas", "Carrots", "Potatoes", "Cod", "Haddock", "Milk", "Bread", "Eggs" ];
      var table_data = [];
       
      table_data.push(Ti.UI.createTableViewSection({ headerTitle: 'Table with rows as label' }));
       
      for(var i=0,j=data.length; i<j; i++){
       
      	var row = Titanium.UI.createTableViewRow({});
       
          var row_label = Titanium.UI.createLabel({
              text: data[i],
      	    textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,
      	    width: Ti.UI.SIZE,
      	    height: Ti.UI.SIZE,
      	    left: 10,
      	    top: 20,
      	    bottom: 20,
      	    font: {fontSize: "16dp"},
      	    highlightedColor: "blue"
      	});
       
        row.add(row_label);
        table_data.push(row);
      };
       
      var table = Ti.UI.createTableView({
        data: table_data
      });
       
      win.add(table);
      navWin.open();
       
      
      

      Actual Result
      On Android, the text colour does not change to blue.

      Expected Result
      The text colour should be blue when highlighted, on Android.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ssaddique Sohail Saddique
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration