用Android中的自定义图片替换Google Plus登录按钮

时间:2015-04-27 06:34:15

标签: android google-plus

我在我的应用程序中集成了Google Plus登录 我想用我的自定义图标更改登录按钮图像。

怎么做?

1 个答案:

答案 0 :(得分:5)

简单,使用Google+ Sign In中的指南,您可以使用简单的按钮

<Button
   android:id="@+id/button"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_centerHorizontal="true"
   android:text="@string/common_signin_button_text_long" />

通过设置onClickListener

 if (mGoogleApiClient.isConnected()) {
      Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
      mGoogleApiClient.disconnect();
      mGoogleApiClient.connect();
    }
相关问题