是的,我在
<com.facebook.widget.ProfilePictureView
line and 这是一个在 stackoverflow 上被问过很多次的问题,每次似乎都通过添加 xmlns:fb="http://schemas.android.com/apk/res -自动”在顶部。好吧,这并没有为我解决问题,不知道为什么 :( 那我该怎么办?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fb="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center_horizontal"
android:orientation="horizontal" >
<com.facebook.widget.ProfilePictureView
android:id="@+id/selection_profile_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_horizontal"
app:is_cropped="true"
facebook:preset_size="small" />
</LinearLayout>
我也试过
xmlns:facebook="http://schemas.android.com/apk/res/com.facebook.samples.profilepicture"
但效果不佳
这是我的 project.properties 文件:
target=android-18
android.library=false
android.library.reference.1=..\\actionbarsherlock
android.library.reference.2=..\\library
android.library.reference.3=../facebook-android-sdk-3.6.0/facebook
尝试将其更改为
target=android-18
android.library=false
android.library.reference.1=..\\actionbarsherlock
android.library.reference.2=..\\library
android.library.reference.3=..\\facebook-android-sdk-3.6.0\facebook
也没有结果
最佳答案
您的 XML 中有两个错误。
1) 你还没有声明命名空间“app”
2) 您已声明命名空间 xmlns:fb="http://schemas.android.com/apk/res-auto" 但您将其称为“facebook”,即 facebook:预设大小
你可以通过以下方式解决这个问题
1) 为“app”添加命名空间声明,即 xmlns:app="http://schemas.android.com/apk/res-auto"
2) 将您的“fb”命名空间声明重命名为“facebook”,即 xmlns:facebook="http://schemas.android.com/apk/res-auto"
关于android - com.facebook.widget.ProfilePictureView - 错误 : Error parsing XML: unbound prefix,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20593245/