文本输入布局显示文本 "Android... TextInputLayout"

Text input layout is showing text "Android... TextInputLayout"

这是我得到的输出代码,如屏幕截图。

我还添加了一些依赖项以便设计支持库工作,但我不知道为什么我得到的是这个文本而不是浮动的 labels.I 我曾在另一个项目中尝试过它,但当我我正在尝试将 activity 集成到一个项目中,这正在发生。

<?xml version="1.0" ng="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/content_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:orientation="vertical"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.hummnbirdfeeders.extension.hummnbirdfeeders.SignInActivity"
    tools:showIn="@layout/activity_signin">
    <android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp">

        <EditText
            android:id="@+id/edFirstName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="@string/hint_first_name"
            android:inputType="textCapWords"/>
    </android.support.design.widget.TextInputLayout>

    <android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp">

        <EditText
            android:id="@+id/edLastName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="@string/hint_last_name"
            android:inputType="textCapWords"/>
    </android.support.design.widget.TextInputLayout>

    <android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp">

        <EditText
            android:id="@+id/edEmailAdress"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="Email Address"
            android:inputType="textEmailAddress"/>
    </android.support.design.widget.TextInputLayout>

    <android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp">

        <EditText
            android:id="@+id/edPhone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="Phone Number"
            android:inputType="textEmailAddress"/>
    </android.support.design.widget.TextInputLayout>
    <Button
        android:layout_width="match_parent"
        android:layout_marginTop="20dp"
        android:text="Submit"
        android:textAllCaps="false"
        android:layout_height="wrap_content"/>
</LinearLayout>

我想你忘了添加 support:design

的依赖项
implementation "com.android.support:support-v13:26.1.0"
implementation 'com.android.support:design:26.1.0'

然后:

<android.support.design.widget.TextInputLayout
        android:id="@+id/input_layout_otp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/dp_10"
        android:textColorHint="@color/white"
        app:hintTextAppearance="@style/EditTextWhiteInputLayout">

        <EditText
            android:id="@+id/et_otp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/dp_10"
            android:background="@drawable/underline_white"
            android:hint="@string/otp"
            android:inputType="number"
            android:textColor="@color/white"
            android:paddingBottom="10dp"
            android:paddingLeft="10dp"
            android:singleLine="true"
            android:textSize="@dimen/sp_14" />
    </android.support.design.widget.TextInputLayout>

和风格的改变

<style name="EditTextWhiteInputLayout" parent="@android`enter code here`:style/TextAppearance">
    <item name="android:textColor">@color/white</item>
</style>