Above picture is the way an arabic word with hareka should look but after applying ForegroundColorSpan
on the second letter(zamma), like below:
TextView textView = findViewById(R.id.simple_tv);
String text = "گُرگ";
SpannableString spann = new SpannableString(text);
spann.setSpan(new ForegroundColorSpan(0xFFFF0000), 1, 2, 0);
textView.setText(spann, TextView.BufferType.SPANNABLE);
the result I get is like below which changes the placement of that letter(zamma) and I couldn't figure out why and how to fix it, any ideas or hints is appreciated in advance
I just tried an alternative, setting html
on textview
but the result is exactly the same
string = "<font color='#FFFFFF'>This is my text </font>" + "<font color='#000000'> Another text </font>";
textView.setText(Html.fromHtml(string));
User contributions licensed under CC BY-SA 3.0