我正在尝试使用TextInputLayout
在我的 XML 中,我遇到了这个错误:
java.lang.RuntimeException: Unable to start activity ComponentInfo{fr.jechange.moncompte/fr.jechange.moncompte.SignUpActivity}: android.view.InflateException: Binary XML file line #36: Error inflating class android.support.design.widget.TextInputLayout
[...]
Caused by: android.view.InflateException: Binary XML file line #36: Error inflating class android.support.design.widget.TextInputLayout
[...]
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/design/R$styleable;
我已经导入了设计库,并且support-v7-appcompat
图书馆。我正在使用Theme.AppCompat.Light.NoActionBar
theme.
我在其中使用的 XML文本输入布局包含类似的内容:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:res="http://schemas.android.com/apk/res-auto"
style="@style/matchParent">
<android.support.design.widget.TextInputLayout
android:id="@+id/input"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:inputType="text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
</RelativeLayout>
如果您从活动中调用布局(包含 TextInputLayout),那么
没有什么只是使用 YouActivityClassName.this 代替 getApplicationcontext 或 YourApplicationClassName.getcontext() 或其他传递上下文的地方
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)