Error inflating class EditText on creating TextInputLayout on Android 4.4.2:

前端 未结 2 1731
挽巷
挽巷 2021-01-02 00:12

I using the TextInputLayout UI mechanism in my login page of the application, everything works great except for device that run the 4.4.2 android version on this devices I h

相关标签:
2条回答
  • 2021-01-02 00:39

    Your problem is with another xml file. I think it's because one of your drawable files that you are using a color attribute in it. read here for more information.

    0 讨论(0)
  • 2021-01-02 00:52

    What fixed this issue was removing the parent="TextAppearance.AppCompat" from the style configuration:

    So now the style looks as follows:

    <style name="TextLabel">
        <!-- Hint color and label color in FALSE state -->
        <item name="android:textColorHint">@color/White</item>
        <item name="android:textColorHighlight">@android:color/white</item>
        <item name="android:textColorLink">@color/White</item>
        <item name="android:textSize">20sp</item>
        <!-- Label color in TRUE state and bar color FALSE and TRUE State -->
        <item name="colorAccent">@color/accent</item>
        <item name="colorControlNormal">@android:color/white</item>
        <item name="colorControlActivated">@color/accent</item>
    </style>
    

    And in the xml layout:

    <android.support.design.widget.TextInputLayout
        android:id="@+id/email_wrapper"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/loginInfiLogoRL"
        android:theme="@style/TextLabel">
    
        <EditText
            android:id="@+id/etUserName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/login_screen_email_hint"
            android:imeOptions="actionNext"
            android:inputType="textEmailAddress"
            android:maxLines="1"
            android:nextFocusDown="@+id/etPassword"
            android:singleLine="true"
            android:textColor="@android:color/white"
            android:textColorHighlight="@color/White"
            android:textColorHint="@android:color/white" />
    
    </android.support.design.widget.TextInputLayout>
    
    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题