那是什么,我有: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