Android - 具有自定义视图的 android.view.InflateException

2024-05-06

嗨,我不断收到此错误 它是第 9 行的 android.view.InflateException xml

这是我的 xml:

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

<com.SpaceShot.single android:id="@+id/single1"
 android:layout_width="wrap_content" 
 android:layout_height="wrap_content">

 </com.SpaceShot.single>

<ListView android:id="@+id/highScores"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content">
</ListView>
</FrameLayout>

你看过吗this https://stackoverflow.com/a/3739853/1012381类似的错误?在这种情况下,它表示您应该在自定义 UI 项目 2 构造函数中包含:
- 一个带有 Context 参数的
- 以及一个带有 Context 和 AttributeSet 的

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android - 具有自定义视图的 android.view.InflateException 的相关文章

随机推荐