0

This is how my activity_mail.xml starts can I add a simple line here to add a background image or is there more to it?

<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:id="@+id/mainLayout">

This is for a tablet app and I want the image center aligned.

Thanks in advance

  • 1
    Possible duplicate of: http://stackoverflow.com/questions/2781593/background-image-placement – zbr Apr 24 '13 at 14:16

1 Answers1

1

Just add

android:background="@drawable/your_image"

and optionally,

android:scaleType="centerInside" 

if you want to maintain image ratio and within the layout.

Neoh
  • 15,906
  • 14
  • 66
  • 78