大佬教程收集整理的这篇文章主要介绍了应用 lineHeight 或 lineSpacingExtra 不起作用,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有简单的 xml 布局,上面有 comments
。
TextVIEw
我正在尝试将 <TextVIEw
androID:ID="@+ID/textVIEw9"
androID:layout_wIDth="wrap_content"
androID:layout_height="wrap_content"
androID:text="TextVIEw1"
app:layout_consTraintBottom_toBottomOf="parent"
app:layout_consTraintEnd_toEndOf="parent"
app:layout_consTraintStart_toStartOf="parent"
app:layout_consTrainttop_totopOf="parent" />
<TextVIEw
androID:ID="@+ID/textVIEw10"
androID:layout_wIDth="wrap_content"
androID:layout_height="wrap_content"
androID:text="TextVIEw2"
app:layout_consTraintEnd_toEndOf="parent"
app:layout_consTraintStart_toStartOf="parent"
app:layout_consTrainttop_toBottomOf="@+ID/textVIEw9" />
属性应用于第二个 linespacingExtra
。它没有任何效果。与 TextVIEw
相同。
我对这些属性如何工作的理解有误吗?
lineHeight
来自docs:
该值不会应用于最后一行文本。
因此,如果您将多行文本添加到 TextView
(例如:TextView1\ntextView2
),它将起作用。
使用多行。 使用“dp”代替“sp”:
android:linespacingExtra="20dp"
以上是大佬教程为你收集整理的应用 lineHeight 或 lineSpacingExtra 不起作用全部内容,希望文章能够帮你解决应用 lineHeight 或 lineSpacingExtra 不起作用所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。