我有以下编辑框(从材料库)
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/myTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:endIconMode="clear_text"
app:counterEnabled="true"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:counterMaxLength="20"
>
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="My Title"
/>
</com.google.android.material.textfield.TextInputLayout>我期望提示文本(“我的标题”)出现在编辑框的边界上,相反它会出现在文本框中,而文本框的大纲没有任何文本。
我该怎么解决这个问题?
编辑-我的应用程序主题的父版本是"Theme.MaterialComponents.DayNight.DarkActionBar“
发布于 2021-12-19 06:58:31
如果其他人感到困惑,提示文本将在空框中显示,并与文本一起浮动。谢谢。
https://stackoverflow.com/questions/70407595
复制相似问题