gpt4 book ai didi

安卓.view.InflateException : Binary XML file line #24

转载 作者:行者123 更新时间:2023-11-29 17:52:13 24 4
gpt4 key购买 nike

我有一个 xml 文件,我想在自定义 ListView 中使用它。xml 文件如下所示:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:padding="5dp" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="50dp"
android:layout_height="50dp"
android:paddingRight="10dp"
android:src="@drawable/ic_launcher" />

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_toRightOf="@id/imageView1"
android:textSize="25dp"
android:gravity="center"/>

<ImageView
android:id="@+id/imageView2"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_alignBottom="@id/textView1"
android:layout_alignParentRight="true"
android:layout_marginRight="25dp"
android:baseline="@id/imageView1"
android:src="@drawable/offline" />
</RelativeLayout>

我正在用我的自定义 ListView 对其进行充气,但它显示错误 inflateException

  02-28 15:50:08.363: E/AndroidRuntime(19777): android.view.InflateException: Binary XML file line #24: Error inflating class <unknown>

最佳答案

 android:baseline="@id/imageView1"

android:baseline 想要一个维度

来自文档:

The offset of the baseline within this view. [dimension]

关于安卓.view.InflateException : Binary XML file line #24,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22093176/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com