Android的 - android.view.InflateException一个自定义视图 [英] Android - android.view.InflateException with a custom view
本文介绍了Android的 - android.view.InflateException一个自定义视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我不断收到此错误
其在行#9 XML的android.view.InflateException
继承人我的xml:
<?XML版本=1.0编码=UTF-8&GT?;
<的FrameLayout的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:方向=垂直
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
>< com.SpaceShot.single机器人:ID =@ + ID / single1
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT> < /com.SpaceShot.single>< ListView的机器人:ID =@ + ID /榜
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT>
< /&的ListView GT;
< /&的FrameLayout GT;
解决方案
你有没有看这的类似的错误?在这种情况下,它说你应该在你的自定义UI项目2的构造函数:结果
- 一个与Context参数结果
- 和一个与语境的AttributeSet
Hi i keep getting this error its an android.view.InflateException at line #9 xml
Heres my 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>
解决方案
Have you looked at this similar error? In that case it says you should have in your custom UI item 2 constructors:
- one with Context parameter
- and one with Context and AttributeSet
这篇关于Android的 - android.view.InflateException一个自定义视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文