レイアウトの例を次に示します。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:text="@string/hello_world" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
受話器(480x800)とタブレット(1280x800)では、レイアウトの残りのスペースは、イメージビューから下部まで異なります。画像はタブレット上で拡大縮小されておらず、dp値は比較的同じ物理値になります。
画像、スペース(dp)が拡大縮小されるように、タブレットの受話器の比率を保存する方法/ツールはありますか?おそらく、values-xlarge / dimen.xml、values-720dp / dimen.xmlを使用できますが、それは多くの機械的な仕事です。より良い解決策はありますか?