<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/mylistview"
android:layout_gravity="center_horizontal"
/>
</LinearLayout>
我在我的项目已经这样布局和AndroidStudio以红色突出部分(@ + ID/mylistview),但一切工作正常, 我可以膨胀XML也findViewById(R。 id.mylistview); 无法找出问题,将鼠标悬停在上面我收到此消息 “顶层元素未完成”。 通过使用ExpandableListView更改ListView,错误消失。ID标签用红色下划线
看起来像我的错误。这里有一些可能的解决方案,但他们都没有为TO工作:http://stackoverflow.com/questions/25058218/id-adview-is-red-why – 2014-09-30 17:39:42