那是什麼,我有:TextInputLayout設計支持庫不顯示setCounterEnable()方法的android
TextInputLayout text1 = (TextInputLayout) view.findViewById(R.id.text1);
我試圖做
text1.setCounterMaxLength(50);
TextInputLayout沒有setCounterMaxLength()方法。我也試圖通過XML
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:counterEnabled="true"
app:counterMaxLength="10">
<android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Username"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:ems="10"
android:hint="Username" />
</android.support.design.widget.TextInputLayout>
它拋出下面的錯誤做到這一點:提前
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
感謝:
Error:(56) No resource identifier found for attribute 'counterEnabled' in package
Error:(56) No resource identifier found for attribute 'counterMaxLength' in package
我使用的gradle以下的依賴。
嘗試'23.1.0',而不是'23.0.1' – CommonsWare
謝謝,但我也嘗試過這一點。它也不起作用。我通過使用23.1.0得到了以下異常:錯誤:配置項目出現問題。 >配置項目'>時發生問題無法解析配置':debugCompile'的所有依賴關係。 >找不到com.android.support:design:23.1.0。 在以下位置搜索: https://jcenter.bintray.com/com/android/support/design/23.1.0/design-23.1.0.pom – Moon
>無法找到com.android.support:design: 23.1.0。 在以下位置搜索: https://jcenter.bintray.com/com/android/support/design/23.1.0/design-23.1.0.pom https://jcenter.bintray.com/com/ android/support/design/23.1.0/design-23.1.0.jar – Moon