To set Background Image in Android application



In android you can set background image by means of properties or by xml file.At first you have to include the image file in drawable-mdpi folder. The format of image should be .png format. Then in main activity xml file just add following code.

// Comment
<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/a_wallpare">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:padding="@dimen/padding_medium"
android:text="@string/hello_world"
tools:context=".MainActivity"/>



</RelativeLayout>



Output Mobile View

raja P Web Developer

2 comments:

  1. There are a few reasons why individuals do this. First is for their own security. Nobody in this world would employ a cleaning specialist or a caretaker that had a few records of grabbing and murder. It is likewise utilized when you buy a firearm, as it is said in the Brady Bill.background investigation sites

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...