1

因为Edittext它不是组小部件中的唯一一个。TextInputLayout提示没有用。告诉我还有什么方法可以求救吗?

这是我的布局:

<android.support.design.widget.TextInputLayout
    android:id="@+id/til_account"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="10dp"
    android:layout_weight="1"
    android:textColorHint="@color/colorTextHint">
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <EditText
            android:id="@+id/et_account_tint"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@color/colorTextHint"
            android:maxLines="1"
            android:theme="@style/EditText"
            android:textSize="16sp" />
        <EditText
            android:id="@+id/et_account"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_alignParentTop="true"
            android:drawableRight="@mipmap/ic_selectcontact"
            android:hint="@string/enter_phone_number_contact_name"
            android:inputType="text"
            android:maxLines="1"
            android:textColorHint="@color/colorTextHint"
            android:textSize="16sp"
            android:theme="@style/EditText" />
        <TextView
            android:id="@+id/et_account_button"
            android:layout_width="70dp"
            android:layout_height="35dp"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:background="@android:color/transparent"
            android:onClick="@{presenter::onClick}"
            android:textSize="16sp"
            tools:ignore="LabelFor" />
    </RelativeLayout>
</android.support.design.widget.TextInputLayout>
4

1 回答 1

1
    Do like this 



           <android.support.design.widget.TextInputLayout
                        android:id="@+id/til_account"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginTop="10dp"
                        android:layout_weight="1"
                        app:hintEnabled="true" app:hintAnimationEnabled="false"
                        android:textColorHint="@color/colorTextHint">

                            <EditText
                                android:id="@+id/et_account_tint"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:textColor="@color/colorTextHint"
                                android:maxLines="1"
                                android:theme="@style/EditText"
                                android:textSize="16sp" />

                 </android.support.design.widget.TextInputLayout>

               <android.support.design.widget.TextInputLayout
                        android:id="@+id/til_account"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginTop="10dp"
                        android:layout_weight="1"
                     app:hintEnabled="true" 
                   app:hintAnimationEnabled="false"
                        android:textColorHint="@color/colorTextHint">
                            <EditText
                                android:id="@+id/et_account"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_alignParentStart="true"
                                android:layout_alignParentTop="true"
                                android:drawableRight="@mipmap/ic_selectcontact"                           android:hint="@string/enter_phone_number_contact_name"
                                android:inputType="text"
                                android:maxLines="1"
                                android:textColorHint="@color/colorTextHint"
                                android:textSize="16sp"
                                android:theme="@style/EditText" />
    </android.support.design.widget.TextInputLayout>
                            <TextView
                                android:id="@+id/et_account_button"
                                android:layout_width="70dp"
                                android:layout_height="35dp"
                                android:layout_alignParentEnd="true"
                                android:layout_alignParentRight="true"
                                android:layout_alignParentTop="true"
                               android:background="@android:color/transparent"
                                android:onClick="@{presenter::onClick}"
                                android:textSize="16sp"
                                tools:ignore="LabelFor" />
于 2017-10-20T21:32:48.037 回答