How to prevent row child changing the background color

You must Login before you can answer or comment on any questions.

When a row of a table view is touched (clicked) the row gets the selected background color. Unfortunately not only the row gets the background color: all child elements are changing to the background color to the row.

This is very nice if you have labels and so on but if you style some graphics with image views and views this behavior is not very helpful!

Is there something I missed? Is there a workaround the keep the background color of the child elements?

2 Answers

try setting this property of tablerow, it worked for me

selectionStyle:0

— answered 2 years ago by Ignasi Artigas
answer permalink
1 Comment
  • Solved my issue;

    When clicking on the row I wanted a popup overlay on that specific row displaying information, by setting the selectionStyle property to zero the overlay view got the proper background color, before the background color of the overlay inherited the background color for the row itself.

    Thanks for sharing.

    — commented 12 months ago by Olivier Alldiksson

Unfortunately that's no solution for me because I want that everything but the elements gets the row background color when the row is selected.

I found out that setting a background gradient of a element overrides the behavior of getting the selection background color. By setting a gradient with two equal colors resolved my problem.

Your Answer

Think you can help? Login to answer this question!