さまざまな画面の解像度をサポートするという点で読むべきことはすべて読みました。また、表示される画像の適切なバリエーションを適切なフォルダーに提供しました。しかし、私は何かに戸惑っています。ImageView のドキュメントによると、android:layout_width と android:layout_height を "fill_parent"/"match_parent" に設定すると、画像が画面いっぱいに引き伸ばされます。(すべての画面密度が同じサイズ/ピクセル数の画面を提供するわけではなく、余分な数ピクセルが画面の下部にパディングされることを望まないため、これが必要なようです)これはいつでも機能するようですが、機能していません私にとっては、ImageView が Horizontalscrollview 内に配置され、画像の幅が画面の幅よりも長い場合です。
以下の私のコード: (アクティビティは私のマニフェストで横向きに設定されています)
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/hscrollview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="0dp"
android:fadingEdge="none"
android:scrollbars="none"
android:overScrollMode="never" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="0dp"
android:fadingEdge="none"
android:scrollbars="none"
android:overScrollMode="never" >
<ImageView
android:id="@+id/MapImageView"
android:src="@drawable/map"
android:layout_width="wrap_content"
android:layout_height="fill_parent" />
</RelativeLayout>
</HorizontalScrollView>
編集: :src を :background に置き換えましたが、効果はありませんでした。
これは、タブレットなどのデバイスで得られる効果です。理想的には、典型的な 480x800 解像度の携帯電話などで、画像が画面全体に表示されるようにしたいと考えています。