1

As you can see from the photo, Facebook SignIn button does not have the same height of the Google SignIn button. How can I make FB button the same height as the other one? Sorry for the stupid question but I am totally new to this world. Photo is here: https://ibb.co/vLSFgH3

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingTop="5dp"
    android:gravity="center"
    android:orientation="horizontal">

    <com.google.android.gms.common.SignInButton
        android:id="@+id/google_button"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1" />

    <com.facebook.login.widget.LoginButton
        android:id="@+id/fb_button"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1.5"
        android:textSize="15sp" />
</LinearLayout>
Frank
  • 69
  • 8

1 Answers1

0

You probably need to manually set the android:layout_height attributes for both of them so that they have the same value. Like so:

<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:gravity="center"
android:orientation="horizontal"
xmlns:android="http://schemas.android.com/apk/res/android">

<com.google.android.gms.common.SignInButton
    android:id="@+id/google_button"
    android:layout_width="0dp"
    android:layout_height="40dp"
    android:layout_weight="1" />

<com.facebook.login.widget.LoginButton
    android:id="@+id/fb_button"
    android:layout_width="0dp"
    android:layout_height="40dp"
    android:layout_weight="1.5"
    android:textSize="15sp" />

Change android:layout_height="40dp" to whatever value looks right. Setting the attribute to android:layout_height="wrap_content" means that the buttons resize themselves so that they take up as much space as they want. Thats why you have to set the heights manually. I have not tested that code, but it should work.

bran
  • 33
  • 1
  • 6
  • Unfortunately, it didn't work. The problem is the Facebook button, it does not change its height even modifying the height attribute... – Frank Jul 03 '19 at 08:10
  • Sorry about that then, I don't actually have the Facebook library installed. Perhaps this link would help: https://stackoverflow.com/questions/29589208/how-to-change-the-height-of-the-log-in-with-facebook-button – bran Jul 04 '19 at 00:05