下午好,我正在尝试解决问题,但无法解决。我有两部智能手机,一部 Nexus 5(Android 6.0)和一部 ZenFone 2(Android 5.0)。该错误仅在 ZenFone 中持续存在。
XML:
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/TextLabel">
<EditText
android:id="@+id/et_login_pass"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/LoginPlaceholderPassword"
android:inputType="textPassword"/>
</android.support.design.widget.TextInputLayout>
android.view.InflateException: Binary XML file line #25: Error inflating class EditText at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
我该怎么办?
最佳答案
您能否将您的 layout_width
更改为 match_parent
并检查您是否确实在 build.gradle 文件中编译了您需要的两个依赖项。
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
关于java - Android - 膨胀类 EditText 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33419065/