In my XML file, I\'m using bitmap as the following
Here t
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.