【问题标题】:Error while inflating item of ListView膨胀 ListView 项目时出错
【发布时间】:2013-09-05 22:12:23
【问题描述】:

我在为 ListView 充气时遇到错误。

它说 android.view.InflateException: Binary XML file line #7: Error inflating class

但是在第 7 行,只有一个 TextView。这是xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/statement_date"
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:textIsSelectable="true"
        android:textSize="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/statement_amount"
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/statement_description"
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>

【问题讨论】:

  • 这是您的自定义 ListVeiw 单元格吗?在这种情况下,请尝试将相同的文件用于多屏幕支持..

标签: android xml listview android-listview


【解决方案1】:

android:textSize="?android:attr/textAppearanceMedium" /&gt; 不应该是 android:textAppearance="?android:attr/textAppearanceMedium" /&gt; 在你的第一个 &lt;TextView 中吗?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-01-09
    • 2016-09-20
    • 2016-07-02
    • 2016-12-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多