Created
October 13, 2016 05:31
-
-
Save androidcodehunter/fdd4efc1cbb3b5c9deb69f3cb0dca727 to your computer and use it in GitHub Desktop.
Removing highlighted color from ClickableSpan in Android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I’ve been struggling for some hours with TextView and Spannable.. ClickableSpan to be precise. It seems that when you tap the clickable text it gets an ugly orange stroke (might differ on devices) around the text and if you so happen to have this in a custom view as an item in e.g Gallery it really stands out by highlighting it everytime you scroll away from that view. Annoying, yes? | |
The solution is extremely simple and was provided by a thread over at Stackoverflow.com. | |
To edit or remove the higlight color you can simply set the TextViews highlight color itself to any color you want or Color.TRANSPARENT if you don’t want any color. | |
android:textColorHighlight="@color/something" | |
or in code | |
textView.setHighlightColor(Color.TRANSPARENT); |
Gracias por la solución!!
Thanks, you save the day!
thanks so much!
Thanks a lot
Thanks, you save my day :)
Thanks, save my day, bro ! 🍺
Happy to help you!
…On Fri, Jul 24, 2020, 8:44 AM yangxiaobin ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Thanks, save my day, bro ! 🍺
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://gist.github.com/fdd4efc1cbb3b5c9deb69f3cb0dca727#gistcomment-3389737>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7R7WOWPCD6GPSF5F5HSSLR5DYPBANCNFSM4HQO4F7A>
.
Set android:textColorHighlight="#00FFFFFF"
works, set android:textColorHighlight="@android:color/transparent"
doesn't work. Thank @fawaz-ahmed
android:textColorHighlight="#00FFFFFF" works , thanks
Set
android:textColorHighlight="#00FFFFFF"
works, setandroid:textColorHighlight="@android:color/transparent"
doesn't work. Thank @fawaz-ahmed
Thanks a lot. This works.
you save my life
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In my case I had to add a bit different color which is transparent whte
android:textColorHighlight="#00FFFFFF"