首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >安卓TextInputField充气错误

安卓TextInputField充气错误
EN

Stack Overflow用户
提问于 2015-06-02 00:52:25
回答 9查看 44.2K关注 0票数 28

在尝试使用新的安卓TextInputField时发生了崩溃,并想分享我的解决方案。

在android appcompat库中尝试新的TextInputField时,我的应用程序崩溃了。这是我的布局xml。

<android.support.design.widget.TextInputLayout
    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="e-mail"
        android:inputType="textEmailAddress"
        android:singleLine="true"/>

</android.support.design.widget.TextInputLayout>

我得到的错误是:

android.view.InflateException: Binary XML file line #20: Error inflating class android.support.design.widget.TextInputLayout.

解决方案:将hintTextAppearance属性添加到您的TextInputLayout中,使lead标记如下所示:

<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:hintTextAppearance="@android:style/TextAppearance.Medium">
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30578976

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档