1

I have integrate facebook sdk using https://developers.facebook.com/docs/android/getting-started step by step .How to change login button height and width?

Sanket990
  • 665
  • 1
  • 10
  • 22

4 Answers4

1

Let's try a workaround: just define the paddings for the button.

   <com.facebook.login.widget.LoginButton
                android:id="@+id/btn_facebook_login"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingTop="16dp"
                android:paddingBottom="16dp"
        />

That works for me.

Dobry
  • 161
  • 5
0

Facebook's new sdk doesn't allow you to change the height of the login button. Instead, I would create a custom button that does this for you.

Sree
  • 2,727
  • 3
  • 29
  • 47
0

just add a style in your facebook login button

<com.facebook.login.widget.LoginButton
    android:id="@+id/login_button"
    android:gravity="center"
    android:layout_centerInParent="true"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    style="@style/FacebookLoginButton"
    />

And in your style write the below code:

<style name="FacebookLoginButton">
        <item name="android:textSize">18sp</item>
        <item name="android:paddingTop">10dp</item>
        <item name="android:paddingBottom">10dp</item>
        <item name="android:layout_gravity">center_horizontal</item>
    </style>
Fay007
  • 2,707
  • 3
  • 28
  • 58
0

To change the height try adding padding both top and bottom

   <com.facebook.login.widget.LoginButton
    android:id="@+id/login_button"
    android:paddingTop="10dp"
    android:paddingBottom="10dp"/> 
PundoJnr
  • 41
  • 1
  • 6