简体   繁体   中英

Can I unify the style of facebook sign in button like Google in android app?

I'm making the app with the sign-in system. But I want to unify the style of each button. My activity_login.xml show what I'm using the widget. I want to apply the Google button style to 'continue with Facebook'.

<com.google.android.gms.common.SignInButton
        android:id="@+id/login_sign_google"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

<com.facebook.login.widget.LoginButton
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

在此处输入图片说明

Simplest solution is just add these buttons in to layout, make their visibility - GONE and add custom buttons with whatever you want styling.

And on click just pass click event like this:

    loginFacebookStyledButton.setOnClickListener {
                loginFacebookActualInvisibleButton.performClick()
     }

With google sign in I dont think that you need to have SignInButton simple styled button does the job.

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