Android TableViewRow selectedColor, selectedBackgroundColor, ... not working with touch, tap, click
Hello again!
I have problems defining a cell-selection style on android,
when clicking/tapping/touching on the table-row.
here is my small sample code:
// create window
var win = Titanium.UI.createWindow({
backgroundColor:'red'
});
// create section
var tableviewSection = Titanium.UI.createTableViewSection();
// create some rows
for (var i = 1; i < 4; i++) {
var row = Ti.UI.createTableViewRow({
backgroundColor: 'blue',
selectedBackgroundColor: 'green', // not working with tap/touch
color: 'yellow',
selectedColor: 'white', // not working with tap/touch
title: 'test ' + i,
className: 'testrow'
});
tableviewSection.add(row);
}
// tableview
var tableview = Ti.UI.createTableView({
data: [tableviewSection]
});
win.add(tableview);
// open window
win.open();
The selectedColor/selectedBackgroundColor property won't affect on clicking, touching, tapping, etc. But if i use the hardware-navigation (trackball, arrow-direction-keys) the selection-style works.
the selection neither works on the android simulator nor on my android device (HTC Hero).
I'm using Titanium SDK 1.4.2 and the android sdk "APIs 2.1-update1".
hope you have some advices/tips for me :)
greetings,
robert
2 Answers
-
Robert
Clicking/tapping/touching is not selecting - you have to create eventListeners to change the colours accordingly. :)
-
meh.. :( didn't want to hear it ;)
but ok, thank you hal, i'll do it with an event-handler.but this would be a great improvement for further Titanium SDK Releases!!
the possibility of giving a visual feedback when touching is absolutely necessary..