Warum ist die Bildansicht nicht in Vollbild?
Ich mache einen Android Projekt. Warum ist die Bildansicht id iv1 und iv2 nicht in den Vollbildmodus? Ich habe meine XML hier unten:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout1"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="10px"
android:paddingLeft="10px"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:id="@+id/iv1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="invisible"
/>
<ImageView
android:id="@+id/iv2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="invisible"
/>
<ImageButton
android:id="@+id/menu_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@+id/BunyiIng"
android:src="@drawable/menu_btn"
android:background="@null"
/>
<ImageView
android:id="@+id/image_logo"
android:src="@drawable/logo_vehicle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginTop="5px"
/>
</RelativeLayout>
</LinearLayout>
Wenn ich die ImageViews in LinearLayout, blockiert es die RelativeLayout.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout1"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="10px"
android:paddingLeft="10px"
>
<ImageView
android:id="@+id/iv1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="invisible"
/>
<ImageView
android:id="@+id/iv2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="invisible"
/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
Aber wenn die Bildansicht sich unter dem RelativeLayout, aber im inneren LinearLayout, die Bildansicht zeigt nicht ein Bild.
</RelativeLayout>
<ImageView
android:id="@+id/iv1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="invisible"
/>
<ImageView
android:id="@+id/iv2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="invisible"
/>
</LinearLayout>
Wie kann ich es lösen? Ich will die Bildansicht zeigt das Bild in Vollbild.
Versuchen Sie dies einmal
android:scaleType=fitXY
InformationsquelleAutor abuybuy | 2012-05-22
Du musst angemeldet sein, um einen Kommentar abzugeben.
InformationsquelleAutor android developer
Verwenden Sie diese Eigenschaft für image-anzeigen:
InformationsquelleAutor RajaReddy PolamReddy
Ich sehen, dass beide Ihre ImageViews Höhe und Breite auf "fill_parent", so dass ich vermute, dass Sie wollen beide bei der Skalierung auf den ganzen Bildschirm. In Fall, dass Sie wollen, dass Sie einfach nur da zu sitzen und nicht gehen, um Sie für später etwas hinzufügen
sowohl Ihre lineare und relative layouts. Es wird ein Bild hinzufügen, um den hintergrund des Layouts zu skalieren, um zu passen das ganze layout, und speichern Sie einige Ressourcen, wenn ich mich nicht Irre.
InformationsquelleAutor Alex Styl