Android Set textview layout width dynamically

前端 未结 1 701
感动是毒
感动是毒 2021-01-15 16:28

I have a listview that consists of two textviews. One for dates, one for names. Config.xml includes the listview:



        
相关标签:
1条回答
  • 2021-01-15 16:42

    You want to use the method setLayoutParams of TextView and pass into it a new LinearLayout.LayoutParams(width, height) where width and height are integers that will specify the width and height. you can keep the height and set the width to whatever you want.

    0 讨论(0)
提交回复
热议问题