gpt4 book ai didi

android - 下划线、光标和提示在焦点上的 TextInputLayout 中的 TextInputEditText 处消失

转载 作者:行者123 更新时间:2023-11-29 22:47:35 25 4
gpt4 key购买 nike

我有一个带有一堆 TextInputEditText 的编辑配置文件屏幕。之前还可以,但是现在焦点上的下划线、光标和提示都看不见了。

有人遇到过同样的问题吗?

enter image description here

...

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilFirstName"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@id/ivContactIcon"
app:layout_constraintEnd_toEndOf="@id/gEnd"
app:layout_constraintTop_toBottomOf="@id/toolbar"
android:layout_marginStart="@dimen/margin_32"
android:layout_marginTop="@dimen/margin_24"
android:hint="@string/profile_edit_hint_first_name"
>

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etFirstName"
android:layout_height="wrap_content"
style="@style/FontRoboRegularSizeMFontPrimaryOneLineMatchWrap"
tools:text="Oleh"
android:inputType="textCapWords"
android:maxLines="1"
android:nextFocusForward="@id/etLastName"
android:imeOptions="actionNext"
/>
</com.google.android.material.textfield.TextInputLayout>

...

更新:更改根元素的背景后,很明显这些元素变成了白色。没有消失。

enter image description here

最佳答案

TextInputLayout 使用的默认样式是

<style name="Widget.MaterialComponents.TextInputLayout.FilledBox" parent="Base.Widget.MaterialComponents.TextInputLayout">
<!-- underline color in FilledBox style -->
<item name="boxStrokeColor">@color/mtrl_filled_stroke_color</item>

<!-- The color of the label when it is collapsed and the text field is active -->
<item name="hintTextColor">?attr/colorPrimary</item>
....
</style>

mtrl_filled_stroke_color 基于 colorOnSurface

检查您的主题的 colorPrimarycolorOnSurface 值,或使用具有上述相同属性的自定义样式。

关于android - 下划线、光标和提示在焦点上的 TextInputLayout 中的 TextInputEditText 处消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58182373/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com