当前位置: 代码迷 >> Android >> 更改Google登录按钮样式的Android
  详细解决方案

更改Google登录按钮样式的Android

热度:9   发布时间:2023-08-04 10:49:52.0

我的家庭活动中有一个Facebook和一个google登录按钮。 我试图将两个按钮的大小设置为相同,但无法这样做。

上面的链接显示了Google登录按钮如何具有默认边界。 我要删除它并使两个按钮相等。这是我的代码。

<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" />

有人能帮我吗?

Google+和Facebook都提供了两种执行登录的方法。 一种是使用它们提供的按钮。 在这种情况下,您不需要额外的代码,因为这些自定义按钮将满足您的所有需求。

另一种方法是必须创建自己的按钮,然后自己处理所有登录代码。 就您而言,我认为这是更可取的主意。

Google+登录:使用GoogleApiClient Facebook登录:使用LoginManager

  相关解决方案