Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12900] Android: Image views in table views swap in and out when scrolling if className is set

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionDuplicate
Resolution Date2013-03-04T18:14:12.000+0000
Affected Version/sRelease 3.0.0, Release 3.0.2
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterBetty Tran
AssigneeIngo Muschenetz
Created2013-03-01T00:08:01.000+0000
Updated2017-03-21T23:03:09.000+0000

Description

Description

When scrolling up and down in a table view with rows that contain image views, the images will swap in and out as we scroll if the className property is set on the row. If there is no className set, the images just blink.

Code to Reproduce

var win = Ti.UI.createWindow({
	backgroundColor: 'gray'
});

var remoteImages = [
"http://farm9.staticflickr.com/8236/8486430790_b2f01934aa_n.jpg", 
"http://farm9.staticflickr.com/8369/8484326899_40e9f77a30_n.jpg",
"http://farm9.staticflickr.com/8226/8485262581_bc917a9623_n.jpg",
"http://farm9.staticflickr.com/8086/8487703846_5b11c467ac_n.jpg",
"http://farm9.staticflickr.com/8509/8486848974_e9b76eeda7_n.jpg",
"http://farm9.staticflickr.com/8225/8486187175_cdaec4ddf5_m.jpg",
"http://farm9.staticflickr.com/8525/8485814568_92909c3b6e_n.jpg",
"http://farm9.staticflickr.com/8087/8485684090_168f7bdd5d_n.jpg",
"http://farm9.staticflickr.com/8523/8485610133_bd2e82438f_n.jpg"];

var localImages = [
"8486430790_b2f01934aa_n.jpg", 
"8484326899_40e9f77a30_n.jpg",
"8485262581_bc917a9623_n.jpg",
"8487703846_5b11c467ac_n.jpg",
"8486848974_e9b76eeda7_n.jpg",
"8486187175_cdaec4ddf5_m.jpg",
"8485814568_92909c3b6e_n.jpg",
"8485684090_168f7bdd5d_n.jpg",
"8485610133_bd2e82438f_n.jpg"];

var rows = [];


for ( i = 0; i < localImages.length; i++) {
	Ti.API.info(" Image: " + localImages[i]);
	var row = Ti.UI.createTableViewRow({
		height : Ti.UI.SIZE,
		width : Ti.UI.FILL,
		layout : "horizontal",//,
		className : "imageRow"
	});
	var image = Ti.UI.createImageView({
		image : localImages[i],
		width : '100dp',
		height : '100dp',
		top : 0,
		left : 50
	})
	var label = Ti.UI.createLabel({
		text : ' row ' + i,
		color : '#textColor',
		height : Ti.UI.SIZE,
		width : Ti.UI.SIZE,
		top : 10,
		right : 50,
		textAlign : 'center'
	});
	row.add(image);
	row.add(label);
	rows.push(row)
}


var menu = Ti.UI.createTableView();
win.add(menu);

menu.setData(rows);

win.open();

Steps to reproduce

1. Open app 2. Scroll up and down Note that this happens regardless of whether or not the images are remote or local.

Attachments

FileDateSize
LocalImages.zip2013-03-04T16:00:23.000+0000364462

Comments

  1. Ingo Muschenetz 2013-03-04

    Resolving as duplicate.
  2. Lee Morris 2017-03-21

    Closing ticket as duplicate with reference to the above comments.

JSON Source