This is a follow up question to: How to implement an android:background that doesn't stretch?.
Santosh's solution works for me
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/dvdr"
android:tileMode="disabled" android:gravity="top" >
</bitmap>
but I have a question to the note of the developers page:
Note: Bitmap files may be automatically optimized with lossless image compression by the aapt tool during the build process. For example, a true-color PNG that does not require more than 256 colors may be converted to an 8-bit PNG with a color palette. This will result in an image of equal quality but which requires less memory. So be aware that the image binaries placed in this directory can change during the build. If you plan on reading an image as a bit stream in order to convert it to a bitmap, put your images in the res/raw/ folder instead, where they will not be optimized.
When I place the bitmap xml file inside the drawable folder and a default dvdr
file of the biggest size and best quality in there as well, does that mean that I can always omit the multiple screen size folders like drawable-xxxhdpi
, drawable-hdpi
,..., that would mean that I don't need to create screen size optimized images for each folder anymore, is that right? If this works so, why do I need the multiple drawable files at all, since I could let do the job by Android.