简体   繁体   中英

No resource identifier found for attribute 'counterEnabled'

<android.support.design.widget.TextInputLayout
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/input_email"
    app:counterEnabled="true"
    app:counterMaxLength="10"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <EditText
        android:id="@+id/email"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/email_hint"
        android:ems="10"
        android:inputType="textEmailAddress"/>

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
    android:id="@+id/input_password"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <EditText
        android:id="@+id/password"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/password_hint"
        android:inputType="textPassword"/>

</android.support.design.widget.TextInputLayout>

<Button
    android:id="@+id/button_save"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/save"
    android:layout_gravity="end"/>

<TextView
    android:id="@+id/success"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="@string/success"
    android:visibility="gone"/>

Whats the problem? I got compile 'com.android.support:appcompat-v7:22.2.0' in my gradle file, also compile 'com.android.support:design:22.2.0' .Why is this not working? and why do i get this strange error?

I think the problem in 'com.android.support:design:22.2.0', because when i use 'com.android.support:design:23.0.1' ,I have the same problem. No resource identifier found for attribute 'counterEnabled' , than change 'com.android.support:design:23.0.1' to 'com.android.support:design:23.1.1' ,this problem has been solved.

the location of attribute '23.1.1'

the location of attribute '23.0.1'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM