3

画面の下部に画像が配置された画面が必要です。画像自体は(リソースから)固定されています。これは非常に大きく、各デバイスの幅に合わせて縮小されています。私は次のように simple を使用しようとしましlayout_alignParentBottomた:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/LayoutLoading"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/startup" >

    <ImageView
        android:id="@+id/ImageView01"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:scaleType="fitCenter"
        android:src="@drawable/loading" />

</RelativeLayout>

はい、これはうまくいきませんでした。画像の正確な高さを ( の代わりにwrap_content) 指定しない限り、ImageViewは下部に配置されません。これはおそらく、実際の画像が画面サイズよりも大きく、画面の幅に縮小した後にのみ「短く」なるという事実によるものです。

ImageViewそれで、問題は、デバイスのサイズに関係なく、画面の下部にとどまるようにするにはどうすればよいですか?

4

1 に答える 1

4

xmlでイメージビューに追加しますandroid:adjustViewBounds="true"

于 2012-12-27T20:40:44.767 に答える