How to align ImageView to the bottom, fill its width and height, and keep its aspect ratio?

后端 未结 6 1951
攒了一身酷
攒了一身酷 2021-02-05 11:36

Background

There are various XML attributes for ImageView to scale its content , and various layout views that allow to place views and set their sizes.

Howeve

6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-05 12:29

    Try using android:scaleType="fitCenter"

    Edit

    Hm, I saw what you mean, another option is to have it fitEnd on the portrait xml and create an identical xml on layout-land folder (create it if needed) with android:scaleType="fitCenter" which will be used on landscape only

提交回复
热议问题