Android - Google SignInButton 文本未居中

Val*_*tin 5 android google-signin

我想com.google.android.gms.common.SignInButton在我的一个布局中使用 a但遗憾的是,没有任何有价值的理由,按钮内的文本不想位于中心。

这是它的外观:

在此处输入图片说明

xml 非常简单,我尝试使用边距/填充/重力/...但没有任何方法可以使文本居中:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include layout="@layout/toolbar" />

    <com.google.android.gms.common.SignInButton
        android:id="@+id/button_google_sign_in"
        android:layout_width="200dp"
        android:layout_height="60dp"
        android:layout_centerInParent="true" />

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

编辑 :

即使有一个完全空的活动,这个按钮也不能正确显示......我疯了吗?

在此处输入图片说明

有人已经遇到过这个问题吗?

谢谢

Jin*_*ose 0

用这个

  compile 'com.google.android.gms:play-services-auth:9.8.0'

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">


<com.google.android.gms.common.SignInButton
    android:id="@+id/button_google_sign_in"
    android:layout_width="200dp"
    android:layout_height="60dp"
    android:layout_centerInParent="true" />
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述