在Eclipse中登录按钮的脸书

时间:2015-04-28 11:40:27

标签: android eclipse facebook-sdk-4.0

我在尝试使用facebook-sdk之后尝试添加此登录按钮:

<com.facebook.login.widget.LoginButton
    android:id="@+id/login_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:layout_marginTop="30dp"
    android:layout_marginBottom="30dp" /> 

eclipse没有显示一个按钮,模拟器不能使用此按钮。谢谢,你..

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

你需要添加这一行,而且它是com.facebook.widget.LoginButton而不是com.facebook.widget.login.LoginButton。

 xmlns:fb="http://schemas.android.com/apk/res-auto"


      <com.facebook.widget.LoginButton
            xmlns:fb="http://schemas.android.com/apk/res-auto"
            android:id="@+id/loginButton"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="#FFFFFF"
            fb:login_text="Sign in with Facebook" />