ImageView in android XML layout with layout_height=“wrap_content” has padding top & bottom

前端 未结 1 1085
心在旅途
心在旅途 2021-02-01 00:56

I have a vertical LinearLayout containing an ImageView and a few other layouts and views.




        
相关标签:
1条回答
  • 2021-02-01 01:43

    I had a simular issue and resolved it using android:adjustViewBounds="true" on the ImageView.

    <ImageView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:contentDescription="@string/banner_alt"
        android:src="@drawable/banner_portrait" />
    
    0 讨论(0)
提交回复
热议问题