私のアプリで Android OS がサイズ変更をどのように処理しているかに悩まされています。基本的に、480x800 (幅 480px) の背景画像と、幅 480px の下部にある画像があります。
以下に示すように、Galaxy S (480x800 画面) ではすべて問題なく表示されます。
ただし、Galaxy S3 (720x1280) では、以下に示すように、背景は幅 720 ピクセルに引き伸ばされますが、下部の画像は幅 640 ピクセルにしかなりません。
640x960 の画像を含む xhdpi フォルダーを作成しようとしましたが、同じことが起こります (背景が 720px に引き伸ばされ、画像のみが 640px に拡大されます)。「ScaleType」でも遊んでみましたが、今のところうまくいきません。
OSが2つの画像のサイズを異なるスケールで変更する理由と、それを修正する方法を知っている人はいますか?
XML は次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/bg" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/significados"
android:layout_gravity="center"
android:layout_marginTop="216dp"
android:onClick="goToSignificados"
/>
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ranking"
android:layout_gravity="center"
android:onClick="goToRanking"
/>
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/engracados"
android:layout_gravity="center"
android:onClick="goToEngracados"
/>
<ImageView
android:id="@+id/iv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="60dp"
android:clickable="true"
android:contentDescription="@string/image"
android:onClick="goToMarket"
android:src="@drawable/googleplay" />
</LinearLayout>