简体   繁体   中英

Change google sign in button style android

I have a facebook and a google sign in button on my home activity. I am trying to set the size of the two buttons same but not able to do so.

https://drive.google.com/file/d/0B4YOVOcFR_ChSlgxb1hJdWRCOG8/view?usp=sharing

The above link shows how the google sign in button has a default boundary. I want to remove it and make the two buttons equal.Here's my code.

<com.facebook.login.widget.LoginButton
        android:id="@+id/fb_login_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:paddingTop="13dp"
        android:paddingBottom="13dp"
        android:layout_margin="3dp"/>

<com.google.android.gms.common.SignInButton
    android:id="@+id/google_login_button"
    android:layout_centerInParent="true"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/fb_login_button" />

Can someone help me?

Both Google+ and Facebook, provides two ways to perform Login. One is to use the Buttons that they provide. In this case, you don't need extra code, since these custom buttons will take care of all you need.

The other way is where you have to create your own button and then handle all the login code yourself. In your case, I think that's the preferable idea.

Google+ sign in: Use GoogleApiClient Facebook login: Use LoginManager

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM