2013-04-16 6 views
8

Qu'aurais-je besoin d'ajouter à cela pour que j'ai une image d'arrière-plan et une couleur d'arrière-plan main.xmlMise en page Android image de fond et la couleur

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="330dp" 
android:layout_height="600dp" 
android:layout_gravity="center|center_vertical" 
android:background="@drawable/background" 
> 

Répondre

8

Vous devriez être en mesure de remplir simplement le parent puis définissez votre image d'arrière-plan en conséquence.

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="@drawable/background" 
> 
+2

Est-il besoin d'arrière-plan Image et couleur non seulement l'image de fond qui remplit la mise en page entière. – Ali

+2

répondre à ma propre question qui n'était même pas la bonne réponse, à la question que j'ai posée. 2 ans plus tard android: background = "@ couleur/white" dans strings.xml ajouter # FFFFFF http://stackoverflow.com/questions/2748830/how-to-change-background-color -in-android-app – MrJoshFisher

Questions connexes