框轮廓覆盖了TextInputEditText提示

问题描述

我正在使用((slides.length !== 0) && (index !== slides.length - 1)) 作为文本输入,当我选择它们时,提示会按原样向上移动,但被框的轮廓所覆盖。有谁知道为什么会这样?

照片

enter image description here

代码

TextInputEditText

解决方法

TextInputEditText

删除

android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"

通过这种方式,您可以在主容器(TextInputLayout)和EditText之间添加页边空白

enter image description here

使用:

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/title_layout"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_marginStart="24dp"
        android:layout_marginEnd="24dp"
        android:hint="...."
        ...
        >

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/title"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:inputType="textCapWords" />

    </com.google.android.material.textfield.TextInputLayout>

enter image description here

,

您要在android:hint="@string/title"中放置com.google.android.material.textfield.TextInputEditText属性。

android:hint="@string/title"应该放在com.google.android.material.textfield.TextInputLayout

<com.google.android.material.textfield.TextInputLayout
        android:id="@+id/title_layout"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColorHint="@color/grey"
        android:theme="@style/OutlinedEditText"
        app:boxStrokeColor="@color/blue"
        app:hintTextColor="@color/blue"
        android:hint="@string/title"
        app:layout_constraintTop_toBottomOf="@id/cover_art">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/title"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_marginStart="24dp"
            android:layout_marginEnd="24dp"
            android:inputType="textCapWords" />

    </com.google.android.material.textfield.TextInputLayout>

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...