使用Android Studio中,我得到这个错误在我的活动布局:Error:(9) No resource identifier found for attribute 'headerView' in package 'com.merahjambutech.zuki.deteksi'
安卓:未找到属性资源标识符“headerView”
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
xmlns:compat="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.merahjambutech.zuki.deteksi.view.PullToZoomListViewEx
android:id="@+id/paralax_social_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@android:color/transparent"
app:headerView="@layout/header_parallax_social" />
</LinearLayout>
我很肯定的布局header_parallax_social.xml可在我的项目文件(RES /布局),这里有header_parallax_social代码:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="160dp" >
<ImageView
android:id="@+id/header_parallax_social_new_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/cd_main_image"
android:scaleType="centerCrop"
android:src="@drawable/parallax_social_small" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:orientation="vertical" >
</LinearLayout>
</RelativeLayout>
我曾试图改变的xmlns:应用程序和类似的东西,但仍没有找到解决方案...
我想你应该使用drawable而不是layout。=>'app:headerView =“@ drawable/header_parallax_social”' –
或者尝试更改'xmlns:app =“http://schemas.android.com/apk/ RES-auto'到'的xmlns:程序=“HTTP:// schemas.android.com/tools' –