I use setLineSpacing() to increase the space between lines in a textView, and it seems okay when I test it with Pixel API 25 emulator, but when I test it with Nexus 6p API 23, it's good till a new line (\n) happens. Then after that, the space between line gets reset. It's like setLineSpacing affects just a part of text(the first paragraph). Why does this happen?
if (android.os.Build.VERSION.SDK_INT >= 23) {
textView.setLineSpacing(textView.getLineHeight(), 0.6f);
}
UPDATE: I kindof found the problem, but no solution so far. I use span to make the first letter in my textView bigger.
wordtoSpan.setSpan(new RelativeSizeSpan(2f), 2, 3, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
Actually, setLineSpacing method does increase the line spacing for the whole text view but there is an extra line spacing for the first line till "\n" because of making the first letter bigger by setSpan. It only happens in older APIs like 23 tho.