使用Drop Cap设置文本样式时,第一行和第二行之间的空格?

时间:2016-07-19 12:47:04

标签: android

我正在尝试使用首字下沉来设置文本样式,但第一行和第二行之间存在间隙。这是我的代码:

    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,最后有一条消息说错误已修复。但我仍然有问题。 enter image description here

1 个答案:

答案 0 :(得分:0)

这对我有用:

<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>