更改文本的颜色TextView的表行的一行点击 [英] Change the color of text in textview in table row on row click
问题描述
我有有一个TextView和imageview.I正在使用选择改变行的背景上点击某些行的表drawable.I也需要改变文字的颜色和click.I的ImageView的图像尝试使用选择为TextView的在<一个解释href=\"http://stackoverflow.com/questions/4247385/how-to-change-color-of-listview-items-on-focus-and-on-click\">here
I have a table with some rows having a textview and imageview.I am changing the background of row on click using a selector drawable.I also need to change the color of text and the imageview image on click.I tried using selector for textview as explained in here
需要在父表行的点击要修改的TextView中的颜色不上textview.The的点击变色不宜persist.It应该只是选定行点击的指示
The color of the textview needs to be changed on click of the parent table row not on the click of the textview.The changed color should not persist.It should be just an indication of the selected row click
但它似乎没有work.Any帮助将是AP preciated
but it doesn't seem to work.Any help would be appreciated
推荐答案
设置OnTouchListener表行作为<一个href=\"http://stackoverflow.com/questions/4468380/android-textview-change-text-color-on-click\">android TextView中:在点击改变文字颜色
Set OnTouchListener for Table row as in android TextView : Change Text Color on click
在ontouch事件从该行获得TextView的孩子并改变其颜色。
In the ontouch event get the textview child from the row and change its color ..
这篇关于更改文本的颜色TextView的表行的一行点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!