问题
I know I can change the size of bitmaps loaded 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?
回答1:
You cannot do this from XML, you have to do it from code.
来源:https://stackoverflow.com/questions/5225562/how-to-change-the-size-of-bitmaps-when-loaded-from-xml