Android Layout Background Image

Now we are going to see about android layout background image. Also you can check our previous post about the android layout background color.

In android, we can set a image to layout as background by using background property in layout. We can set image to any layout like relative, table, linear, etc.

Example for Android Layout Background Image :-

[sourcecode language="xml"]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bbg">
<Button android:text="@+id/Button01"
android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
[/sourcecode]

The output will looks like
layoutbacckgroundimage

Comments

Thanks williams

Thanks williams