だから私はAndroidのレイアウトの初心者で、学んでいRelativeLayout
ます。私は次のことをしようとしています:
ただし、仮想デバイスで取得できるのは、スペース (幅と高さ) の 100% を占める名前フィールドだけです。
ここに私のXMLがあります:
<?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:orientation="vertical"
android:id="@+id/root">
<EditText android:id="@+id/name"
android:layout_alignParentLeft="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint = "Name"/>
<EditText android:id="@+id/phone"
android:layout_below="@id/name"
android:layout_alignParentRight="true"
android:layout_weight="0.4"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:hint="Phone" />
<EditText android:id="@+id/email"
android:layout_below="@id/phone"
android:layout_alignParentRight="true"
android:layout_weight="0.4"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:hint="Email" />
<EditText android:id="@+id/dob"
android:layout_below="@id/email"
android:layout_alignParentRight="true"
android:layout_weight="0.4"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:hint="D.O.B." />
<EditText android:id="@+id/address"
android:layout_below="@id/phone"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@id/dob"
android:layout_weight="0.6"
android:layout_height="0dp"
android:layout_width="match_parent"
android:hint="Address" />
<Button android:id="@+id/submit"
android:layout_weight="1.0"
android:layout_below="@id/address"
android:layout_height="match_parent"
android:layout_width="0dp"
android:text="Submit"/>
</RelativeLayout>
何がうまくいかないのですか?