2016-03-06 34 views
0

發現屬性沒有資源標識符 '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"/> 

請告訴我這個問題?我在我的gradle文件中編譯了'com.android.support:appcompat-v7:22.2.0',也編譯'com.android.support:design:22.2.0'。爲什麼這不起作用?爲什麼我會得到這個奇怪的錯誤?

+0

後完整的XML –

+0

通過底鞋它,更新compiledsdkversion到最新。 – user3278732

回答

3

我認爲'com.android.support:design:22.2.0', 問題,因爲當我使用'com.android.support:design:23.0.1',我有同樣的問題。 找不到屬性'counterEnabled'的資源標識符, 比'com.android.support:design:23.0.1'更改爲'com.android.support:design:23.1.1',此問題已得到解決。

the location of attribute '23.1.1'

the location of attribute '23.0.1'

相關問題