0
EditTextのための永久的なアンダーラインを作成するにはどうすればいいですか? 別のトピックで回答が見つかりませんでした。 私はそのような何かを達成したいと思います: アンダーライン編集テキスト
EditTextのための永久的なアンダーラインを作成するにはどうすればいいですか? 別のトピックで回答が見つかりませんでした。 私はそのような何かを達成したいと思います: アンダーライン編集テキスト
あなたはこのようstyle.xml
であなたのEditTextのためのカスタムスタイルを使用することができます -
<!-- Edit text -->
<style name="editTextStyle" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:textSize">@dimen/auth_text_paragraph_little</item>
<item name="android:layout_gravity">left</item>
<item name="android:focusable">true</item>
<item name="colorControlNormal">@color/editUnderLine</item>
<item name="colorControlActivated">@color/colorAccent</item>
<item name="colorControlHighlight">@color/colorAccent</item>
<item name="android:textColorHint">@color/hint</item>
</style>
@color/editUnderLine
はあなたとしてcolor.xml
ファイルから使用する色の名前です。以下のようなstring.xml
ファイルとdimen.xml
ファイルとして
とあなたのXMLにこのカスタムスタイルを使用してレイアウト -
<EditText
android:id="@+id/edt_phone_number"
style="@style/editTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/auth_margin_half"
android:padding="@dimen/auth_margin_half_plus"
android:fontFamily="@string/auth_font_family_regular"
android:hint="@string/auth_mobile_number"
android:inputType="phone"/>
これを試してみましたか:http://stackoverflow.com/a/37101446/2632867 – Alvi