Android bitmap image size in XML

后端 未结 8 1062
情书的邮戳
情书的邮戳 2020-12-08 03:34

In my XML file, I\'m using bitmap as the following


Here t

8条回答
  •  萌比男神i
    2020-12-08 04:23

    Although there is no width and height parameters for bitmap, you can set bitmap size using gravity and item width/height.

    
        
    
    

    You can set item width and height and scale bitmap inside of it using gravity.

    I know this is old question but maybe someone will find it useful.

    WARNING:

    As already mentioned in comments, this method ONLY works with API level 23 (Android 6.0) and up.

提交回复
热议问题