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

Android: ScrollView not scrolling with horizontal layout

    Details

      Description

      The following test case does not work with horizontal layout:

      var win = Ti.UI.createWindow();
      win.open();
        
      var scrollView = Ti.UI.createScrollView({
          contentHeight:'auto',
          contentWidth:0,
          layout:'horizontal',
          backgroundColor: 'green'
      });
      win.add(scrollView);
       
      var colors = ['red', 'blue', 'pink', 'white', 'black'];
        
      var max = 120;
      for(var i = 0; i < max; i++){
          scrollView.add(Ti.UI.createView({
              backgroundColor: colors[i%colors.length],
              height: 100,
              left: 10,
              width: 100,
              top: 10
          }));
      }
      

      When we have an inner view with size behavior and a horizontal layout child, The scroll view does not scroll either:

      var win = Ti.UI.createWindow();
      win.open();
        
      var scrollView = Ti.UI.createScrollView({
          contentHeight:'auto',
          contentWidth:0,
          backgroundColor: 'green'
      });
      win.add(scrollView);
        
      var innerView = Ti.UI.createView({
          height:Ti.UI.SIZE, // works if set to 1000
          layout:'horizontal',
          left:0,
          top:0,
          right:0
      });
      scrollView.add(innerView);
        
      var colors = ['red', 'blue', 'pink', 'white', 'black'];
        
      var max = 120;
      for(var i = 0; i < max; i++){
          innerView.add(Ti.UI.createView({
              backgroundColor: colors[i%colors.length],
              height: 100,
              left: 10,
              width: 100,
              top: 10
          }));
      }
      

      Expected Result (for both test cases):
      The scroll view should be able to scroll vertically. (works in iOS)

      Actual Result (for both test cases):
      It does not scroll

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ayeung Allen Yeung
                Reporter:
                ayeung Allen Yeung
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code