Created
March 26, 2015 19:20
-
-
Save ammarques/31402368b0ab15716865 to your computer and use it in GitHub Desktop.
Different sizes in the same TextView while keep their style.
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 text = "R$ 2.086,01" | |
String pathern = ","; | |
int start = text.lastIndexOf(pathern); | |
int end = ((text.length()) - start); | |
final SpannableString span = new SpannableString(text); | |
span.setSpan(new RelativeSizeSpan(0.5f), start, (start + end), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | |
someTextView.setText(span); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment