Problem mit layout-hintergrund-Bild

Ich versuche, ein Bild wie hintergrund-Bild in ein layout (per xml oder code)

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/main_layout"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:background="@drawable/my_image">

oder

View myLayout= findViewById( R.id.main_layout);
myLayout.setBackgroundResource(R.drawable.my_image);

Mein problem ist als android-Update das Bild in der alle hintergrund-Bildschirm, vergrößern, verkleinern und ändern Sie die Bild-Verhältnis.

Wie kann ich ein Bild, und das Bild braucht nur den nötigen Raum? (ohne Bild Größenänderung)

  • wenn Sie android:layout_width="fill_parent" android:layout_height="fill_parent" auch Ihr hintergrund "fill_parent"
InformationsquelleAutor Jose Manuel | 2011-03-29
Schreibe einen Kommentar