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

Android: Setting zIndex on views inside ScrollView doesn't work

    Details

      Description

      When you add two views to a scrollview and try to set zIndex on runtime, nothing happens. It works when added to a view or a window.

      Example code:

      var win = Ti.UI.createWindow({ 
      backgroundColor : "#FFF" 
      }); 
       
      var scrollview = Titanium.UI.createScrollView({ 
      contentHeight : '700dp' 
      }); 
       
      var viewYellow = Titanium.UI.createView({ 
      top : 10, 
      left : 10, 
      width : 100, 
      height : 100, 
      backgroundColor : 'yellow', 
      zIndex : 1 
      }); 
       
      var viewRed = Titanium.UI.createView({ 
      top : 60, 
      left : 60, 
      width : 100, 
      height : 100, 
      backgroundColor : 'red', 
      zIndex : 2 
      }); 
       
      var buttonChange = Titanium.UI.createButton({ 
      width : 120, 
      height : 50, 
      right : 10, 
      top : 10, 
      title : 'Change' 
      }); 
       
      scrollview.add(viewYellow); 
      scrollview.add(viewRed); 
      scrollview.add(buttonChange); 
      win.add(scrollview); 
       
      var i = 0; 
       
      buttonChange.addEventListener('click', function() { 
      if (i % 2 == 0) { 
      viewYellow.setZIndex(3); 
      viewRed.setZIndex(1); 
      i++; 
      } else { 
      viewYellow.setZIndex(1); 
      viewRed.setZIndex(3); 
      i++; 
      } 
      }); 
       
      win.open();

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bijuexalture Biju pm
                Reporter:
                koesh Ernesto Lage
                Reviewer:
                Vishal Duggal (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration