私はXMlを使用してフローティングラベルを設計しましたが、フローティングラベルは必須フィールドには適用されませんが、通常フィールドには適用されるため、ファーストネームおよびモバイル番号などの必須フィールドを含むログインページを作成しています。ログインページの必須フィールドのフローティングラベル
まず、あなたはGradleの中にコードを追加する必要があります:私はhint.Belowが、私は誰もがあなたがこの例を参照することができ、私はこの
<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_password"
android:layout_width="match_parent"
android:layout_below="@+id/input_layout_email"
android:layout_height="wrap_content">
<EditText
android:id="@+id/mobilenumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:textSize="15dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
をお試しください赤い始まりですが、ヒントで可能です。 –
私はそうは思わない、edittextが空の場合はsetError()を行う。 –
固定赤を表示したい場合、回避策はFrameLayoutを使ってTextInputLayoutとTextViewをラップすることである。 TextViewを左下に揃え、leftPaddingをEditTextに追加して、入力されたテキストが* –