Add Resource and setting background in android

In this article is very simple, Today we will discussing about how to add background to our layout in android application. In android provide you to customize them of your application. You can put the image that you want. Okay now let's start with me..

This case I create new project open eclipse tool for android and go to File--> New --> Android Project

1. We need image for our background ( .jpg, png, gif...) and move the image to folder of our project.
it specify of your work space that allocated by your tool.



Click on newly project on folder res/layout  have file name main_activity.xml open it and bellow from this code

<RelativeLayout xmlns: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/Untitled"
    tools:context="com.example.simpltutorial.MainActivity" >

 
</RelativeLayout>



Post a Comment

0 Comments