如何摆脱 ExpandableListView 的警告 "cannot resolve symbole 'id/andr'"”
How to get rid of the warning "cannot resolve symbole 'id/andr'" for ExpandableListView"
一个应用使用了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 有以下警告:
如何消除警告?
我不知道什么是 ( id="@id/android:list")
给它一个普通的 id ( @+id/androidlist )
并在您的代码中处理它
但如果您了解如何使用 ExpandableListView
我更喜欢这个 link 教程 ExpandableListView Link
GL先生
这可能是一个错字。将其更改为:
"@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)
一个应用使用了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 有以下警告:
如何消除警告?
我不知道什么是 ( id="@id/android:list")
给它一个普通的 id ( @+id/androidlist ) 并在您的代码中处理它
但如果您了解如何使用 ExpandableListView 我更喜欢这个 link 教程 ExpandableListView Link
GL先生
这可能是一个错字。将其更改为:
"@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)