Prevent background image from stretching the view

后端 未结 6 1517
予麋鹿
予麋鹿 2021-02-18 12:36

Whenever I assign background to a view that is laid out with wrap_content, if the background image is larger than a view, the view is stretched so that it can hold the entire ba

6条回答
  •  耶瑟儿~
    2021-02-18 13:19

    Either override the methods getSuggestedMinimumWidth and getSuggestedMinimumHeight of your layout view or the methods getMinimumWidth and getMinimumHeight of your background drawable to achieve that.

提交回复
热议问题