[TIMOB-19664] Windows: ListItem title color is black (should be white) and cannot be changed
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | None |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2015-11-02T20:11:27.000+0000 |
| Affected Version/s | Release 5.0.2 |
| Fix Version/s | Release 5.1.0 |
| Components | Windows |
| Labels | n/a |
| Reporter | Fokke Zandbergen |
| Assignee | Kota Iguchi |
| Created | 2015-10-02T14:05:49.000+0000 |
| Updated | 2015-11-07T00:55:14.000+0000 |
Description
The following sample based on the [first classic sample in the docs](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListView) shows that on Windows ListItem titles default to black, which is not readable on the default black background color. It also shows that setting the
color property of the ListItem doesn't work either, which is [documented](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListItem-property-color) but makes the built-in templates pretty much useless.
var win = Ti.UI.createWindow({backgroundColor:'#888'});
var listView = Ti.UI.createListView();
var sections = [];
var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});
var fruitDataSet = [
{properties: { title: 'Apple', color: '#FFF'}}, // has no effect
{properties: { title: 'Banana'}},
];
fruitSection.setItems(fruitDataSet);
sections.push(fruitSection);
var vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables'});
var vegDataSet = [
{properties: { title: 'Carrots'}},
{properties: { title: 'Potatoes'}},
];
vegSection.setItems(vegDataSet);
sections.push(vegSection);
listView.sections = sections;
win.add(listView);
win.open();
var fishSection = Ti.UI.createListSection({ headerTitle: 'Fish'});
var fishDataSet = [
{properties: { title: 'Cod'}},
{properties: { title: 'Haddock'}},
];
fishSection.setItems(fishDataSet);
listView.appendSection(fishSection);
Attachments
| File | Date | Size |
|---|---|---|
| wp_ss_20151002_0003.jpg | 2015-10-02T14:05:44.000+0000 | 25005 |
https://github.com/appcelerator/titanium_mobile_windows/pull/459
Verified using: Windows 10 Pro Appc Core: 5.1.0-42 Appc NPM: 4.2.1 Ti SDK: 5.1.0.v20151104190037 Using the code provided ListItem title color is now white and the color can be changed Closing ticket