“ 机器人:MAXLINES = “1” 机器人:maxWidth = “160dp” android:text =“风格asd伤心 ADAS </跨度> cvfvd dff dzxczx zc xcc x c“ app:layout_constraintStart_toStartOf =“父……” app:layout_constraintTop_toTopOf =“parent”/&gt;
根据文本长度,点的位置和显示的数量变化的问题!
例如如果文字是:“风格asd悲伤 ADAS </跨度> …
这是因为你有 android:maxLines="1" 。为了支持更大的文本maxlines应该增加。如果maxlines设置为1,即使文本很大,textview也无法跳转到下一行
android:maxLines="1"
如果,它会给出更好的结果 android:maxWidth="160dp" 已移除
android:maxWidth="160dp"
的 要么 强>
摆脱 android:maxLines 并使用 android:singleLine="true" , 见下文
android:maxLines
android:singleLine="true"
<TextView android:id="@+id/tvStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginTop="10dp" android:ellipsize="end" android:maxWidth="160dp" android:singleLine="true" android:text="Style asd sad adas cvfvd dff dzxczx zc xcc x c" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" />