How do you scale and stuff the raster plant used as background?

I have the following code in a drawable bitmap xml file. And the background of the linear Layout set to it.

<?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/background_screen" android:tileMode="repeat" android:scaleHeight="10" android:scaleWidth="10" /> 

The image palette is OK, but it does not scale. What do I need to do / fix to get scale?

thanks

+6
source share
1 answer

In my experience, it’s better to create raster images of different sizes for each density you are targeting. Thus, you do not need to worry about these scale attributes and get clear results on any device.

These scale attributes are not defined for BitmapDrawables. They exist for ScaleDrawables designed to scale another. Take a look:

http://developer.android.com/guide/topics/resources/drawable-resource.html#Scale

+6
source

Source: https://habr.com/ru/post/918978/


All Articles