您好我使用提示编辑文字
当我没有将gravity
编辑文本用作 center
但是当我使用android:gravity="center"
时,它没有显示提示
有谁知道为什么?
这是我的代码
<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:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
<LinearLayout
android:id="@+id/LinearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:orientation="vertical" >
<include layout="@layout/header" />
</LinearLayout>
<RelativeLayout
android:id="@+id/rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/maroon"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/login_rllogin"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_centerInParent="true"
android:visibility="gone" >
<EditText
android:id="@+id/login_et_password"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/white"
android:gravity="center"
android:hint="@string/login_hint_enterpassword"
android:inputType="numberPassword"
android:maxLength="4"
android:maxLines="1"
android:textColor="@color/black"
android:textColorHint="@color/dark_gray" />
<Button
android:id="@+id/login_btn_login"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_alignLeft="@+id/login_et_password"
android:layout_alignRight="@+id/login_et_password"
android:layout_below="@+id/login_et_password"
android:layout_marginTop="5dp"
android:background="@color/fent_orange"
android:text="@string/login_btn_caption"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/black"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/login_rlreg"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_centerInParent="true"
android:visibility="visible" >
<EditText
android:id="@+id/login_et_repassword"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="1dp"
android:background="@color/white"
android:gravity="center"
android:hint="@string/login_hint_reenterpassword"
android:inputType="numberPassword"
android:maxLength="4"
android:maxLines="1"
android:textColor="@color/black"
android:textColorHint="@color/dark_gray" />
<Button
android:id="@+id/login_btn_submit"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_alignLeft="@+id/login_et_repassword"
android:layout_alignRight="@+id/login_et_repassword"
android:layout_below="@+id/login_et_repassword"
android:layout_marginTop="5dp"
android:background="@color/fent_orange"
android:text="@string/submit_btn_caption"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/black"
android:textStyle="bold" />
<EditText
android:id="@+id/login_et_choosepassword"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_above="@+id/login_et_repassword"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/white"
android:gravity="center"
android:hint="@string/login_hint_choosepassword"
android:inputType="numberPassword"
android:maxLength="4"
android:maxLines="1"
android:textColor="@color/black"
android:textColorHint="@color/dark_gray" >
<requestFocus />
</EditText>
</RelativeLayout>
<TextView
android:id="@+id/tvAppTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/login_rlreg"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:gravity="center"
android:text="@string/app_name"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="26sp"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/textView1"
android:background="@color/white" >
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/ztam"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="7dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/login_rlreg"
android:layout_marginTop="70dp"
android:background="@color/fent_orange"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
</RelativeLayout>