<TextView
android:/>          //设定文本最多为4行

 

 

if(mDescTextView.getLineCount() > 4){//判断行数大于多少时改变
int lineEndIndex = mDescTextView.getLayout().getLineEnd(3); //设置第4行打省略号
String text = mDescTextView.getText().subSequence(0, lineEndIndex-3) +"...";
mDescTextView.setText(text);
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-23
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
相关资源
相似解决方案