Last active
November 21, 2016 11:35
-
-
Save tokudu/82523b1bd33b8880e5c2 to your computer and use it in GitHub Desktop.
BackgroundColorSpan Example
This file contains 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
String str = "Some really long string goes in here"; | |
Spannable spannable = new SpannableString(str); | |
spannable.setSpan(new BackgroundColorSpan( | |
getResources().getColor(android.R.color.black) | |
), 0, str.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | |
yourTextView.setText(spannable); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment