各位板友好
想請問如果 text 字數過多, TextView 顯示不下
多餘的字想在後面顯示 ... 效果
例如:
這是一個範例, 想了解更多...
這樣 TextView 要怎麼設定呢?
我發現 TextView 設定 android:singleLine="true" 的話, 自動會有 ... 的效果
但如果不是 singleLine 呢?
我現在是
<TextView
android:id="@+id/txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lines="2">
lines = "2" 好像就不work 了
有人知道怎麼解? ellipsize 好像也不work
先謝謝各位
作者: passli 2014-07-15 23:43:00
因為你 layout_width="match_parent" 設定成這樣子所以他parent有多寬就有多寬,改成warp_content 看看