Android - Set a border around an ImageView

前端 未结 9 1400
旧时难觅i
旧时难觅i 2021-02-06 23:50

I have a cell with a fixed width and height, let it be 100x100px. Inside that cell I want to display an ImageView with a border around.
My first idea was to put

9条回答
  •  死守一世寂寞
    2021-02-07 00:02

    just add bellow line in your ImageView layout

    if layout_width and layout_height of imageview is not match_parent than use,

    android:adjustViewBounds = "true"
    

    or

    android:adjustViewBounds = "true"
    android:scaleType="fitXY"
    

    or

    android:adjustViewBounds = "true"
    android:scaleType="centerCrop"
    

提交回复
热议问题