How do I make my ImageView a fixed size regardless of the size of the bitmap

前端 未结 3 1953
灰色年华
灰色年华 2020-12-28 13:03

So I\'m loading images from a web service, but the size of the images are sometimes smaller or bigger than other images and the visualization looks silly when I put them in

3条回答
  •  时光说笑
    2020-12-28 13:34

    Just delete the maxHeight and maxWidth attributes and enter your units in layout_width and layout_height appropriately. But do not use the px unit - use dp instead, because these are device-independent.

提交回复
热议问题