How to add padding for background image

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:

<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
    android:drawable="@drawable/your_background_image"
    android:insetRight="25dip"
    android:insetLeft="25dip" />

and then in your xml layout:

<LinearLayout  xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/inset_background">

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)