Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15846] iOS: View disappears from the listView when click on the listView row

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2013-12-19T18:37:28.000+0000
Affected Version/sRelease 3.1.2, Release 3.1.3, Release 3.2.0
Fix Version/sn/a
ComponentsiOS
LabelsListViews, supportTeam
ReporterMeenakshi Pathak
AssigneeIngo Muschenetz
Created2013-11-28T10:25:28.000+0000
Updated2017-03-22T22:56:00.000+0000

Description

In a listView, view disappears when click on some listView row. *Steps to Reproduce* 1. Create a new Titanium project. 2. Copy and paste the below code :
var win = Ti.UI.createWindow({
	backgroundColor : 'white'
});
var myTemplate = {
	childTemplates : [{
		type : 'Ti.UI.View',
		bindId : 'pic',
		properties : {
			width : '15dp',
			height : '15dp',
			left : 5,
			backgroundColor : 'red'
		}
	}, {
		type : 'Ti.UI.Label',
		bindId : 'info',
		properties : {
			color : 'black',
			font : {
				fontFamily : 'Arial',
				fontSize : '20dp',
				fontWeight : 'bold'
			},
			left : '60dp',
			top : 0,
		}
	}, {
		type : 'Ti.UI.Label',
		bindId : 'es_info',
		properties : {
			color : 'gray',
			font : {
				fontFamily : 'Arial',
				fontSize : '14dp'
			},
			left : '60dp',
			top : '25dp',
		}
	}]
};

var listView = Ti.UI.createListView({
	templates : {
		'template' : myTemplate
	},
	defaultItemTemplate : 'template'
});
var sections = [];

var fruitSection = Ti.UI.createListSection({
	headerTitle : 'Fruits / Frutas'
});
var fruitDataSet = [{
	info : {
		text : 'Apple'
	},
	es_info : {
		text : 'Manzana'
	}
}, {
	info : {
		text : 'Banana'
	},
	es_info : {
		text : 'Banana'
	}
}];
fruitSection.setItems(fruitDataSet);
sections.push(fruitSection);

var vegSection = Ti.UI.createListSection({
	headerTitle : 'Vegetables / Verduras'
});
var vegDataSet = [{
	info : {
		text : 'Carrot'
	},
	es_info : {
		text : 'Zanahoria'
	}
}, {
	info : {
		text : 'Potato'
	},
	es_info : {
		text : 'Patata'
	}
}];
vegSection.setItems(vegDataSet);
sections.push(vegSection);

var grainSection = Ti.UI.createListSection({
	headerTitle : 'Grains / Granos'
});
var grainDataSet = [{
	info : {
		text : 'Corn'
	},
	es_info : {
		text : 'Maiz'
	}
}, {
	info : {
		text : 'Rice'
	},
	es_info : {
		text : 'Arroz'
	}
}];
grainSection.setItems(grainDataSet);
sections.push(grainSection);

listView.setSections(sections);
win.add(listView);
win.open();
3. Run it on iOS7 simulator/device and tap on some row of a listView. *Expected Behavior* : The view should appears even on clicking the row. *Actual behavior* : The 'Red' view disappeared from the listView row on click. *Note* : Please find the attached screenshot of the actual behavior.

Attachments

FileDateSize
Screen Shot 2013-11-28 at 3.50.21 PM.png2013-11-28T10:25:28.000+000036085

Comments

  1. Vishal Duggal 2013-12-19

    This is native ios behavior. When a TableViewCell is selected/highlighted, iOS automatically clears the backgroundColor of all subviews. This has been reported before. The simple workaround is to use a backgroundImage instead of a backgroundColor
  2. Lee Morris 2017-03-22

    Closing ticket as "Won't Fix".

JSON Source