嗨我一直收到这个错误并且没有找到解决方案。我已经改变了Api级别,然后为构建目标做了同样的事情。我不知道这里有什么问题。请帮助。
android:minSdkVersion="14" android:targetSdkVersion="18"
list_item.xml文件
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<textview
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignparentleft="true"
android:layout_alignparenttop="true"
android:layout_marginleft="26dp"
android:layout_margintop="23dp"
android:text="Medium Text"
android:textappearance="?android:attr/textAppearanceMedium" >
</textview>
</relativelayout>
这是主要的xml文件
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Main" >
<listview
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignparentleft="true"
android:layout_alignparenttop="true" >
</listview>
</relativelayout>
我收到这些错误
error: No resource identifier found for attribute 'layout_alignparenttop' in package 'android'
error: No resource identifier found for attribute 'layout_alignparenttop' in package 'android'
error: No resource identifier found for attribute 'layout_margintop' in package 'android'
error: No resource identifier found for attribute 'layout_alignparentleft' in package 'android'
error: No resource identifier found for attribute 'textappearance' in package 'android' list_item.xml
error: No resource identifier found for attribute 'layout_alignparentleft' in package 'android' list_item.xml
答案 0 :(得分:2)
您<relativelayout>
中的错误XML
。它应该是<RelativeLayout>
同样更正textview
至TextView
和listview
至ListView
@Aldo Borrero的评论