How to change the size of bitmaps when loaded from xml
I know I can change the size of bitmaps lo开发者_运维技巧aded programmatically by using BitmapFactory.Options (i.e. forcing 32 via ARGB_8888 or 16 bit via RGB_565). Is there an equivalent when loading bitmaps via xml (such as when defining drawables and background images in a layout)? If there isn't a built-in switch available that configures this, is there a way to accomplish this other than stripping the graphics out of the xml and handling them manually?
You cannot do this from XML, you have to do it from code.
精彩评论