在Android中,如果长度大于某个限制,我怎么能通过在文本末尾放三个点来限制TextView的宽度?
can*_*ova 10
将此代码放入TextView
android:ellipsize="end"
android:singleLine="true" // if you want 3 dots for single line, add this.
android:maxLines="2" // if you want 3 dots after two lines, add this.
Run Code Online (Sandbox Code Playgroud)