У меня есть простая компоновка с 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
быть 1/4 от размера экрана.
попробовать это http://stackoverflow.com/questions/29025843/android-devices-with-different-height-takes-same-layout-folder/29026085#29026085 –
Вы пробовали с 'LinearLayout', потому что у него есть свойство' android: weight = {value} ' –