Id标记用红色下划线

时间:2014-09-30 17:17:12

标签: android xml android-layout android-studio

<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并查找ViewById(R.id.mylistview); 无法解决问题,将鼠标放在上面我收到此消息 &#34;顶级元素未完成&#34;。 通过使用ExpandableListView更改ListView,错误消失。

1 个答案:

答案 0 :(得分:0)

以下链接中有一个错误报告报告了一个非常类似的问题。也许它是Android Studio的错误?它在Eclipse中是否会出现相同的错误?如果没有,可能是下面报告的相同错误。

https://code.google.com/p/android/issues/detail?id=55633

相关问题