Skip to content Skip to sidebar Skip to footer

How To Stretch Image To Row Height In Layout?

There're text view and image in one row. I need to stretch image proportionally to be the same height as text view. How to do that? That's layout:

Solution 1:

in your ImageView

Try this code

android:layout_alignBottom="@+id/textView1"

instead of

android:layout_centerVertical="true"

Solution 2:

just use layout_alignTop and layout_alignBottom to align your views from Top and Bottom to have the same Height

Solution 3:

try to use android:layout_weight. Weight can only be used in LinearLayout

Post a Comment for "How To Stretch Image To Row Height In Layout?"