How to add padding for background image

后端 未结 4 961
野的像风
野的像风 2021-02-02 08:11

I have a LinearLayout which has a background image (a 9 patched png file). How can I add padding to left and right so that the background image does not take up the

4条回答
  •  独厮守ぢ
    2021-02-02 08:43

    You should use xml drawable, specially designed for this purposes - Inset Drawable: http://developer.android.com/guide/topics/resources/drawable-resource.html#Inset

    For example:

    res/drawable/inset_background.xml:

    
    
    

    and then in your xml layout:

    
    

提交回复
热议问题