简体   繁体   中英

Sign in button google with correct style

I want to do a google sign in button with "diferent" style, but i don't know how to do exactly.

I want this style but with a google icon in left:

在此处输入图片说明

So (But with border):

在此处输入图片说明

With Facebook button I can, only I needed put a drawable in "android:background" with this style:

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
    <corners
        android:radius="100dp"
        />
    <solid
        android:color="#415dae"
        />
    <padding
        android:left="0dp"
        android:top="0dp"
        android:right="0dp"
        android:bottom="0dp"
        />
    <size
        android:width="270dp"
        android:height="40dp"
        />
</shape>

But with google, I tried with "Button" normal in xml, and with "SigninButton" adding a background, and i can't do.

Some idea?

The sign in buttons that come with the Facebook and Google APIs are restricted in what you can change to their design. I would suggest designing your own button according to how you like it and then put an onClickListener to it to handle when to login.

Alternatively you can use android:onClick="method name here" right in the button xml and declare a method which takes a view as argument (important).

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