해결책을 찾았습니다.
이 XML :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Helloooooooooooooooooooooo Wooooooooooooooooooooooooorld!"
android:id="@+id/tv1"
android:textColorLink="@android:color/holo_blue_dark"
android:ellipsize="end"
android:singleLine="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Helloooooooooooooooooooooo Wooooooooooooooooooooooooorld!"
android:id="@+id/tv2"
android:textColorLink="@android:color/holo_blue_dark"
android:ellipsize="end"
android:lines="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Helloooooooooooooooooooooo Wooooooooooooooooooooooooorld!"
android:id="@+id/tv3"
android:textColorLink="@android:color/holo_blue_dark"
android:ellipsize="end"
android:maxLines="1"/>
</LinearLayout>
이 ![enter image description here](https://i.stack.imgur.com/8HM0W.png)
OK 같은 디자인의 미리보기에서 렌더링, 모든 ellipsizes 여기서 일. 실제 기기에서 보이는 것처럼 ![enter image description here](https://i.stack.imgur.com/BLzre.png)
android : singleLine = "true"는 사용되지 않지만 더 이상 사용되지 않습니다. 3 개의 기기에서 테스트되었습니다.
그래, XML 레이아웃 미리보기에서 작동합니다. 하지만 런타임에 작동하지 않습니다. [Firstword ..._____] 표시 고유 한 ttf 서체와 함께 사용자 지정 TextView를 사용하고 있기 때문일 수 있습니까? –
textView.setEllipsize (TextUtils.TruncateAt.END); – PravinCG
textView.setEllipsize (TextUtils.TruncateAt.END)도 작동하지 않습니다. 기본 TextView도 있습니다. –