0

I am using this android:textIsSelectable="true" in my TextView for select + copy-paste options and it's working just fine. But I just run into a problem, The selection part appear to be transparent in color. attaching the screenshot for understanding enter image description here

Now I want to change the color of the selected portion . Is there a way to change the selected portion color.Any help is greatly appreciated.

Edit

Ok ,I seems to have find the issue.The issue was because I was not calling super on onDraw() instead I was drawing the text ie canvas.drawText() I made a small workaround for it, which is not perfect.Does anyone know how to set the highlight path using canvas.drawText() ?

Sunil Sunny
  • 3,949
  • 4
  • 23
  • 53
  • Did you tried providing a selector drawable as textcolor by setting android:state_focused/android:state_pressed color – Febi M Felix Mar 11 '16 at 10:51
  • http://stackoverflow.com/questions/4336218/android-textview-change-color-on-changing-of-state you mean something like this ..? Which is for changing the textcolor right ? – Sunil Sunny Mar 11 '16 at 10:56
  • Yes..2nd answer from that link. – Febi M Felix Mar 11 '16 at 10:59
  • I dont want the text color to change ... I want something like this http://i.stack.imgur.com/zF9JD.png I want to change the background of selection.. – Sunil Sunny Mar 11 '16 at 11:04

0 Answers0