How to set maxLines and ellipsize of a TextView at the same time

前端 未结 7 1811
挽巷
挽巷 2021-01-30 12:54

I want to limit my text view to have maximum of 5 lines, so I did:



        
7条回答
  •  梦谈多话
    2021-01-30 13:03

    Progrmatically, you can use:

    your_text_view.setEllipsize(TextUtils.TruncateAt.END);
    your_text_view.setMaxLines(4);
    your_text_view.setText("text");  
    

提交回复
热议问题