所以我试图做一个简单的注册活动,但我的观点与预期不一致。
XML:
<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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.mylifeinformationsharedsocial.SignUpActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/username_id"
android:text="@string/username_text"
android:textSize="20sp"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/username_edit_text_id"
android:hint="@string/username_hint_texts"
android:layout_toRightOf="@id/username_id"
android:layout_toEndOf="@id/username_id"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/password_id"
android:text="@string/password_text"
android:textSize="20sp"
android:layout_below="@id/username_edit_text_id"
/>
<EditText
android:id="@+id/password_edit_text_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:hint="@string/passworde_hint_texts"
android:layout_toRightOf="@id/password_id"
android:layout_toEndOf="@id/password_id"
android:layout_below="@id/username_edit_text_id"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/email_id"
android:text="@string/email_text"
android:textSize="20sp"
android:layout_below="@id/password_id"
/>
<EditText
android:id="@+id/email_edit_text_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:hint="@string/email_hint_text"
android:layout_toRightOf="@id/email_id"
android:layout_toEndOf="@id/email_id"
android:layout_below="@id/password_edit_text_id"
/>
<Button
android:id="@+id/sign_up_button_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sign_up_button_text"
android:layout_below="@id/email_id"
/>
图形布局:
我似乎找不到它有什么问题。任何帮助将不胜感激。如图所示,问题在于电子邮件向下。它非常向前,但显然不是。