简体   繁体   English

Android必须具有ID为的Expandableview

[英]Android must have Expandableview whose id is

Your content must have a ExpandableView whose id is attribute is 'android.R.list' 您的内容必须具有一个ID为属性为'android.R.list'的ExpandableView。

This is the error message I am getting from Logcat. 这是我从Logcat得到的错误消息。 Which is confusing me as my XML is this 这让我感到困惑,因为我的XML是

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


        <ExpandableListView
                android:id="@+id/list"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"/>

</LinearLayout>

try this 尝试这个

<ExpandableListView   
     android:id="@id/android:list"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"/>

ExpandableListView ExpandableListView

when you define id like this @+id/list means that you define an id name list in your application namespace and you can refer to it by @id/list , but @android:id/list means that you are referring to an id define in the android namespace This namespace is the namespace of the framework 当您像这样定义id时,@ + id / list表示您在应用程序名称空间中定义了一个id名称列表,并且可以通过@ id / list引用它,但是@android:id / list表示您正在引用一个id在android名称空间中定义此名称空间是框架的名称空间

In your XML make this android:id="@+id/list" to this android:id="@android:id/list" . 在您的XML中,将此android:id =“ @ + id / list”设置为此android:id =“ @ android:id / list” It will solve your problem. 它将解决您的问题。

See this link for more help. 请参阅链接以获取更多帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android:内容必须有一个 id 属性为 &#39;android.R.id.list 的 ListView - Android: Content must have a ListView whose id attribute is 'android.R.id.list Logcat错误内容必须具有ID属性为&#39;android.R.id.list&#39;的ListView - Logcat error-Content must have a ListView whose id attribute is 'android.R.id.list' 您的内容必须具有ID属性为“ android.R.id.list”错误的ListView - Your content must have a ListView whose id attribute is 'android.R.id.list' error ListFragment:运行时错误“您的内容必须具有ID属性为&#39;android.R.list&#39;的ListView - ListFragment: Runtime error "Your content must have a ListView whose id attribute is 'android.R.list' 为什么我会收到“您的 TabHost 必须有一个 TabWidget,其 id 属性为‘android.R.id.tabs’”错误? - Why do I get an "Your TabHost must have a TabWidget whose id attribute is 'android.R.id.tabs'" error? 引起原因:java.lang.IllegalArgumentException:二进制XML文件第9行:必须指定唯一的android:id,android:tag或具有ID的父对象 - Caused by: java.lang.IllegalArgumentException: Binary XML file line #9: Must specify unique android:id, android:tag, or have a parent with an id for 我的内容有一个ID为&#39;tabhost&#39;的TabHost - My content DOES have a TabHost whose id is 'tabhost' @Binds方法必须仅具有一个其类型可分配给返回类型的参数 - @Binds methods must have only one parameter whose type is assignable to the return type 插入数据,“ MobileServiceTable必须定义一个id属性” - Inserting data, “MobileServiceTable must have a single id property defined” 在expandableview上的错误什么都没有出现 - Error on expandableview Nothing appearing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM