Android中的Google加上登录按钮样式

时间:2014-02-04 16:12:59

标签: android google-plus android-styles

是否可以更改布局xml文件中Google+朗读按钮的样式?根据品牌指南here,您有四种选择。 我知道可以通过此answer中的代码执行此操作,但如果可能的话,我想避免这样做。

2 个答案:

答案 0 :(得分:1)

正如在其他post上回答的那样,您可以通过添加&来完成XML。使用app命名空间(因为它们是自定义属性):

<com.google.android.gms.common.SignInButton
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/sign_in_button"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:buttonSize="wide"
      app:colorScheme="dark"
      />

可能的属性值包括:

  • buttonSize:"wide", "icon_only" or "standard"(默认)
  • colorScheme:"dark", "light" & "auto"(默认)

答案 1 :(得分:0)

如果您只想更改大小和某些布局方面,是的,应该可以在布局xml中使用。您可以参考herehere了解详情;

举个例子:

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