Wykonuję projekt Android. Dlaczego identyfikator ImageView iv1 i iv2 nie jest w trybie pełnoekranowym? Ja położyłem XML tutaj:Dlaczego obraz nie jest wyświetlany na pełnym ekranie?
<?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>
Gdybym umieścił ImageViews w LinearLayout, że zablokował 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"
>
Ale jeśli celowniki kolimatorowe jest umieszczony poniżej RelativeLayout, ale wewnątrz LinearLayout The ImageView nie wyświetla obrazu.
</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>
Jak mogę to rozwiązać? Chcę, aby obraz wyświetlał obraz na pełnym ekranie.
Spróbuj tego raz - "android: scaleType = fitXY' – Praveenkumar