我实现了具有自定义样式的自定义edittext:
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Username"
android:textColorHint="@color/white"
app:hintAnimationEnabled="true"
app:hintTextAppearance="@style/TExtAppearance"
>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/colorAccent"
android:theme="@style/EditTextStyle"
android:id="@+id/username"
android:maxLines="1"
android:maxLength="50"
android:inputType="textEmailAddress|textNoSuggestions"
android:nextFocusDown="@+id/password"
/>
这是屏幕:
只有光标,现在当我再次选择光标时,我得到了:
我不要光标下方的黄色下划线.
这已在Android 7.0的Moto g4中进行了测试.
@color/white
@color/white
@color/white
@color/white
16sp
@color/white
@color/colorAccent
编辑
如果我seterror和错误文本不可见,也会在错误下划线: