Android Google+ SignInButton。如何在xml中设置size属性

问题描述 投票:14回答:4

这里是XML的基本Google+ Android登录按钮:

<com.google.android.gms.common.SignInButton
    android:id="@+id/sign_in_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

在类documentation中,您可以将按钮的大小指定为ICON_ONLY,STANDARD和WIDE。

您如何使用xml进行此操作?

android google-plus
4个回答
8
投票

这里是如何在XML中进行操作。


2
投票

这里是有关大小和样式的SignInButton方法列表:


1
投票

setSize()是一个公共方法,请尝试在运行时通过java as使用它。


0
投票
mSignInButton.setSize(1); // SIZE_WIDE
mSignInButton.setSize(2); // SIZE_ICON_ONLY
mSignInButton.setSize(0); // SIZE_STANDARD
© www.soinside.com 2019 - 2024. All rights reserved.