Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[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

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2017-07-05T18:13:52.000+0000
Affected Version/sRelease 3.0.0, Release 3.0.2
Fix Version/sBacklog
ComponentsAndroid
LabelssupportTeam
ReporterRupesh Sharma
AssigneeEric Merriman
Created2013-04-11T12:22:00.000+0000
Updated2017-07-05T18:13:52.000+0000

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

Comments

  1. Lee Morris 2017-07-05

    Can no longer reproduce the issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1 GA Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source