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

Android:In tableViewRow containing the scrollable view when updateRow method is called it does not display the first row of the scrollable view

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: Release 3.0.0, Release 3.0.2
    • Fix Version/s: Backlog
    • Component/s: Android
    • Labels:
    • Environment:

      Device : Samsung s2

      Description

      Description

      In TableView having 2 rows one with ScrollableView in it and other having a button. ScrollableView contains 3 views with different colors(pink/green/black) is added using appendRow works fine for the first time when application started. But on click event listener of button the updateRow method is called which causes ScrollableView dosen't display the first view! if you scroll through the ScrollableView and back to the first, then it display correctly.

      Steps to Reproduce

      1. Please use the code below:

      // Main Window
      var win = Ti.UI.createWindow({
      	backgroundColor: 'white',
      });
       
      // TableView
      var table = Titanium.UI.createTableView({
      	data: []
      });
       
      // Row 1 with ScrollableView
      var view1 = Ti.UI.createView({ backgroundColor: 'pink' });
      var view2 = Ti.UI.createView({ backgroundColor: 'green' });
      var view3 = Ti.UI.createView({ backgroundColor: 'black' });
      var scrollableView = Ti.UI.createScrollableView({
        views: [view1,view2,view3],
        showPagingControl: true,
        width: 500,
        height: 200
      });
      var row1 = Titanium.UI.createTableViewRow();
      row1.add(scrollableView);
      table.appendRow(row1);
       
       
      // Row 2 - Refresh Button
      var row2 = Titanium.UI.createTableViewRow();
      var viewButton = Titanium.UI.createView({
      	width: 500,
      	height: 300
      });
      var button = Titanium.UI.createButton({
         title: 'Refresh',
         width: 500,
         height: 300
      });
      button.addEventListener('click', function(e){
       
      	// Row 1 with ScrollableView
      	var view1 = Ti.UI.createView({ backgroundColor: 'pink' }); // >> after press refresh, this view dosen't display!
      	var view2 = Ti.UI.createView({ backgroundColor: 'green' });
      	var view3 = Ti.UI.createView({ backgroundColor: 'black' });
      	var scrollableView = Ti.UI.createScrollableView({
      	  views: [view1,view2,view3],
      	  showPagingControl: true,
      	  width: 500,
      	  height: 200
      	});
      	var newRow1 = Titanium.UI.createTableViewRow();
      	newRow1.add(scrollableView);
      	table.updateRow(0, newRow1);
       
      });
      viewButton.add(button);
      row2.add(viewButton);
      table.appendRow(row2);
       
      win.add(table);
      win.open();
      

      2. Install ad run the application. You see the first row having pink color and other views on scrolling.
      3. Click on refresh button
      4. First view is not displayed.

      Note: It worked fine on 2.1.4 GA

        Attachments

          Activity

            People

            • Assignee:
              emerriman Eric Merriman
              Reporter:
              rsharma Rupesh Sharma
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration