我正在尝试设置带有首字下沉大写的文本样式,但第一行和第二行之间存在间隙。下面是我的代码:
Spannable wordtoSpan = new SpannableString(quote);
wordtoSpan.setSpan(new TextAppearanceSpan(mView.getContext(), R.style.SpecialTextAppearance), 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
quoteText.setText(wordtoSpan);这描述了问题https://code.google.com/p/android/issues/detail?id=191187,最后有一条消息说bug已经修复。但是我仍然有这个问题。

发布于 2019-08-19 18:17:54
这对我来说很有效:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lineSpacingExtra="7sp"/>如果你想把你的风格
<style name="YourTextViewStyle" parent="YourTheme">
<item name="android:lineSpacingExtra">7sp</item>
</style>https://stackoverflow.com/questions/38459053
复制相似问题