Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13061] Android: ImageView: Images are not rendered correctly if the url is not valid

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-03-14T19:01:38.000+0000
Affected Version/sRelease 3.1.0
Fix Version/sRelease 3.1.0, 2013 Sprint 06 API, 2013 Sprint 06
ComponentsAndroid
Labelsapi, qe-testadded, triage
ReporterPing Wang
AssigneePing Wang
Created2013-03-14T06:55:54.000+0000
Updated2013-09-26T07:03:24.000+0000

Description

Steps to reproduce: 1. Run the test code. Row 2, Row 4 and Row 8 have no images. 2. Scroll up and down the list view. Expect result: Row 2, Row 4 and Row 8 should always have no images. Actual result: Row 2, Row 4 and Row 8 have random images showing.
var win = Ti.UI.createWindow({
	backgroundColor : 'white'
})

var listContainer = Ti.UI.createView({
	height : '90%'
})

win.add(listContainer);
win.open();

//Basic List View, default template
//Checking to see how height is being set
var listView = Ti.UI.createListView({
	defaultItemTemplate : Ti.UI.LIST_ITEM_TEMPLATE_DEFAULT
})
//Both header and footer
var listSection1 = Ti.UI.createListSection({
	headerTitle : 'HEADER1',
	footerTitle : 'FOOTER1'
})
listSection1.setItems(getDataDefaultTemplate());
//Only header
var listSection2 = Ti.UI.createListSection({
	headerTitle : 'HEADER2',
})
//Only footer
var listSection3 = Ti.UI.createListSection({
	footerTitle : 'FOOTER3'
})
//Neither
var listSection4 = Ti.UI.createListSection({
})

if (Ti.Platform.osname == 'android') {
	listSection2.setItems(getDataDefaultTemplate());
	listSection3.setItems(getDataDefaultTemplate());
	listSection4.setItems(getDataDefaultTemplate());
}
listView.setSections([listSection1, listSection2, listSection3, listSection4]);
listContainer.add(listView);

function getDataDefaultTemplate() {
	var data = [];
	var titleStr = '';

	for ( i = 0; i < 10; i++) {
		titleStr += 'title ';
		var mod = i % 4;
		var cellh = 50;
		var acType = Ti.UI.LIST_ACCESSORY_TYPE_NONE;
		var ci = 'KS_nav_ui.png';
		if (mod == 1) {
			acType = Ti.UI.LIST_ACCESSORY_TYPE_CHECKMARK;
			cellh = 70;
			ci = 'KS_nav_views.png';
		} else if (mod == 2) {
			acType = Ti.UI.LIST_ACCESSORY_TYPE_DETAIL;
			ci = 'junk';
			cellh = 90;
		} else if (mod == 3) {
			acType = Ti.UI.LIST_ACCESSORY_TYPE_DISCLOSURE;
			cellh = 110;
			ci = 'http://www.catravelservices.com/management/hotels/pictures/Mawamba_lodge_nature.jpg';
		}
		var item = {
			template : Ti.UI.LIST_ITEM_TEMPLATE_DEFAULT,
			properties : {
				title : titleStr + i,
				image : ci,
				accessoryType : acType,
				itemId : 'Item ' + i + ' ' + acType,
				height : cellh
			}
		}
		data.push(item)
	}
	return data;
}

Comments

  1. Ping Wang 2013-03-14

    PR: https://github.com/appcelerator/titanium_mobile/pull/3965
  2. Shyam Bhadauria 2013-03-15

    Verified with the latest build.No images are shown in row 2,4 and 8 now even after scrolling. Environment used for verification - Titanium SDK: 3.1.0.v20130314163255 Titanium  Studio:3.0.2.201302151605 Device: Samsung GALAXY Note (2.3.6)

JSON Source