【发布时间】:2015-08-07 09:52:41
【问题描述】:
看起来TextInputLayout 在ViewPager 中不起作用。
错误是:
膨胀类 android.support.design.widget.TextInputLayout 时出错
Appcompat 和 Design library 添加。 Theme 是正确的。
我使用PageAdapter 膨胀和填充ViewPager。
TextInputLayout 视图在应用程序的所有其他部分膨胀得很好。
layout 我为ViewPager 膨胀。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="My Edit Text" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
【问题讨论】:
-
@IntelliJAmiya,除了
ViewPager,视图在其他任何地方膨胀,所以它不是主题、库或任何东西。 -
整个 logcat 是什么?它抛出了哪个异常?或者这是一个“预览”错误?
-
请在 logcat 中发布详细的错误信息!
-
@Eugene 你找到解决方案了吗?
标签: android android-viewpager android-textinputlayout