Search code examples
androidandroid-recyclerviewitem-decoration

How to make recyclerview hight same as tallest item when multiline text present?


I am using recyclerview where item can have multiline text.the problem arise when one item has single line text and other has multiple lines of text.one item get bigger than other.

I want item height will be same as talles item.How i can achive this?

enter image description here


Solution

  • You can give fixed height to TextView. Like

    android:layout_height="50dp"
    

    Or you can set fix number of lines of TextView

    android:lines="2"