How do you scale and tile a bitmap drawable being used as a background?

前端 未结 1 2268
傲寒
傲寒 2021-02-20 15:53

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


    <         


        
相关标签:
1条回答
  • 2021-02-20 16:25

    In my experience it is better to create different sized bitmaps for each density you are targeting. That way you don't have to worry about these scale attributes and get crisp results on any device.

    These scale attributes are not defined for BitmapDrawables. They exist for ScaleDrawables which are meant to scale another drawable. Have a look at:

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

    0 讨论(0)
提交回复
热议问题