简体   繁体   中英

Is it possible to edit google sign in button without creating a new one ourselves

Here the Google sign-in button is not matching with the Facebook sign-in button theme:

图片

I want to edit the Google sign-in button to match the with my app layout and also with the text of the Facebook button. So it would match the theme.

Is there any way to customize this button only without creating a new button and handling it all the logic code.

Google Button XML code

<com.google.android.gms.common.SignInButton
          android:id="@+id/btn_GoogleLogIn"
          android:layout_width="wrap_content"
          android:text = "@string/googleSignIn"
          android:layout_height="wrap_content"
          android:layout_gravity="center_horizontal" />`

These are some docs from the Google and also from the Facebook , here you can get all the attributes support in those buttons and customise them.

And it would be better that your own custom AppCompatButtons for this work because this would be great for matching with the colors you are using in your app. An article on creating custom buttons.

But if you want to go with those buttons you are using , then look at this answer it would be helpful you.

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