私はあなたがプレイできる4つのレベル/モードで簡単なレイアウトを持っています。問題は、私は別の画面上でレイアウトをプレビューするとき、それは同じ表示されないサイズである: Imageレイアウトをさまざまな画面サイズにするにはどうすればいいですか?
ここレイアウトコードです:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:background="#000000">
<TextView
android:layout_width="match_parent"
android:layout_height="120dp"
android:text="play"
android:gravity="center"
android:textSize="50sp"
android:id="@+id/one"
android:layout_alignParentTop="true"
android:background="@drawable/mode1background"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:textColor="#000000" />
<TextView
android:layout_width="match_parent"
android:layout_height="120dp"
android:text="play"
android:gravity="center"
android:textSize="50sp"
android:id="@+id/two"
android:background="@drawable/mode2background"
android:layout_below="@+id/one"
android:layout_alignParentRight="true"
android:layout_alignParentLeft="true"
android:textColor="#000000" />
<TextView
android:layout_width="match_parent"
android:layout_height="120dp"
android:text="play"
android:gravity="center"
android:textSize="50sp"
android:id="@+id/three"
android:background="@drawable/mode3background"
android:layout_below="@+id/two"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:textColor="#000000" />
<TextView
android:layout_width="match_parent"
android:layout_height="120dp"
android:text="play"
android:gravity="center"
android:textSize="50sp"
android:id="@+id/four"
android:background="@drawable/mode4background"
android:layout_below="@+id/three"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:textColor="#000000" />
</RelativeLayout>
は、どのように私は、各TextView
は、画面サイズの4分の1も作ることができます。
http://stackoverflow.com/questions/29025843/android-devices-with-different-height-takes-same-layout-folder/29026085#29026085 –
これを試してみるあなたが試してみました'LinearLayout'は、プロパティが' android:weight = {value} 'であるため –