定制Android的Facebook的登录按钮按钮、Android、Facebook

2023-09-12 03:55:06 作者:火影再陪我年.好吗?

我要定制Facebook登录按钮,这是我们获得与Facebook的SDK以及为Android(Facebook的Andr​​oid的SDK-3.0.1)的外观。我想要一个简单的Andr​​oid按钮,通过Facebook登录有标题。我无法找到有关的任何文件。

i want to customize the look of the facebook login button which we get along with the facebook sdk for android (facebook-android-sdk-3.0.1). i want a simple android button which has title "Login via facebook". i could not find any documentation regarding that.

因此​​,如果任何人知道如何做一个简单的方法,请告诉我,或直接我就怎么做吧。

so if any one knows on how to do it in a simple way, please tell me or direct me on how to do it.

推荐答案

您可以使用样式像这样modifiy登录按钮

You can use styles for modifiy the login button like this

<style name="FacebookLoginButton">
    <item name="android:textSize">@dimen/smallTxtSize</item>
    <item name="android:background">@drawable/facebook_signin_btn</item>
    <item name="android:layout_marginTop">10dp</item>
    <item name="android:layout_marginBottom">10dp</item>
    <item name="android:layout_gravity">center_horizontal</item>
</style>

和布局

<com.facebook.widget.LoginButton
        xmlns:fb="http://schemas.android.com/apk/res-auto"
        android:id="@+id/loginFacebookButton"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        fb:login_text="@string/loginFacebookButton"
        fb:logout_text=""
        style="@style/FacebookLoginButton"/>