2011-08-05 7 views
0

je me main.xml et dans le code XML je:couleur de fond d'applications Android

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#ffffff"> 
    <ImageView android:id="@+id/imageView1" android:layout_height="wrap_content" android:src="@drawable/logo" android:layout_width="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="116dp"></ImageView> 
    <TextView android:layout_height="wrap_content" android:text="Administration 0.0.1" android:textAppearance="?android:attr/textAppearanceSmall" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_below="@+id/imageView1" android:layout_centerHorizontal="true"></TextView> 

</RelativeLayout> 

Mais quand je lance l'application dans un émulateur, le thème par défaut montre toujours avec le fond noir. Je ne peux pas comprendre pourquoi il fait ça.

Des idées?

+0

il devrait fonctionner. Pourriez-vous poster le code autour d'elle? – Suchi

+0

Fait - merci pour lookign – oli

Répondre

0

Quelle couleur d'arrière-plan attendez-vous? Il apparaît correctement pour moi si vous attendez blanc. C'est ce que l'écran ressemble à (je substitué votre image avec l'icône Android)

My Screen

Est-ce que votre onCreate() ressemble à ceci -

@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.main); 
} 
+0

Salut - Non, il semble blanc pour moi aussi dans la vue de conception, mais quand je l'exécute dans l'émulateur, il revient au noir. Oui mon onCreate() ressemble à ça aussi ... – oli

+0

Il a semblé blanc pour moi sur l'émulateur aussi bien qu'un appareil. Quel émulateur utilisez-vous? Quelle version d'Android utilisez-vous? – Suchi

+0

J'ai utilisé Android 2.1 – oli