gpt4 book ai didi

android-studio - 如何摆脱警告 "cannot resolve symbole ' id/andr '"for ExpandableListView"

转载 作者:行者123 更新时间:2023-12-03 17:54:23 24 4
gpt4 key购买 nike

一个应用程序使用 ExpandableListActivity ,而ExpandableListView的用法是基于文档的标准:

<ExpandableListView
android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:divider="@android:color/transparent"
android:dividerHeight="5dip"
android:layout_marginTop="10dip">
</ExpandableListView>

Android Studio 3.2 有以下警告:
enter image description here

我怎样才能摆脱警告?

最佳答案

这可能是一个错字。将其更改为:

"@android:id/empty"


"@android:id/list"

另见 https://developer.android.com/reference/android/app/ListActivity

ListActivity has a default layout that consists of a single, full-screen list in the center of the screen. However, if you desire, you can customize the screen layout by setting your own view layout with setContentView() in onCreate(). To do this, your own view MUST contain a ListView object with the id "@android:id/list" (or R.id.list if it's in code)

关于android-studio - 如何摆脱警告 "cannot resolve symbole ' id/andr '"for ExpandableListView",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52618549/

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