How to create white border around bitmap?

后端 未结 8 1717
萌比男神i
萌比男神i 2021-02-12 19:24

For example I want a white border of 10pixel around all 4 side of the bitmap. I am not using it for imageview I am currently using this code to crop image. May I know how I coul

8条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-12 19:40

    A super easy way of doing it would be to set the ImageView background to white and add a padding value.

    If that doesn't work, create a FrameLayout with w/h of wrap_content, set its background to white, put the ImageView in there, and set the ImageView's margins to the desired border width.

提交回复
热议问题