【发布时间】:2015-08-11 19:22:32
【问题描述】:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:facebook="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="20dp" >
<com.facebook.login.widget.LoginButton
android:id="@+id/fb_login_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
facebook:confirm_logout="false"
facebook:fetch_user_info="true" />
<TextView
android:id="@+id/user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
android:textSize="18sp" />
<Button
android:id="@+id/update_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="update_status" />
<Button
android:id="@+id/post_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="post_image" />
</LinearLayout>
这是我收到错误的面部登录页面:
- error: No resource identifier found for attribute 'fetch_user_info' in package
'com.example.facebookexmaple'
- error: No resource identifier found for attribute 'confirm_logout' in package
'com.example.facebookexmaple'
at <com.facebook.login.widget.LoginButton
虽然我已经添加了库和 facebook 名称空间,但请告诉我如何修复它。
【问题讨论】:
-
你为facebook添加了gradle吗?
-
不,我在 Eclipse 中这样做
-
它不起作用我也添加了该代码,但这个 xml 错误不会发生