安卓:AccountPicker集光主题 [英] Android : AccountPicker set Light Theme

本文介绍了安卓:AccountPicker集光主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以设置选择对话框的主题?

Is it possible to set the theme of picker dialog ?

import com.google.android.gms.common.AccountPicker;
....
String[] accountTypes = new String[]{"com.google"};
Intent intent = AccountPicker.newChooseAccountIntent(null, null,
                accountTypes, false, null, null, null, null);
activity.startActivityForResult(intent, REQUEST_CODE_PICK_ACCOUNT);

我的基础应用主题是安卓Theme.Light ,但该对话框是黑暗的。 谢谢你。

My base app theme is android:Theme.Light but that dialog is dark. Thanks.

推荐答案

如果你想改变对话的主题,你应该改变 newChooseAccountIntent ZZA 并添加两个整数参数。第一个是用于覆盖主题并将其设置为1将改变对话的主题为光。

If you wish to change the theme of the dialog, you should change the newChooseAccountIntent to zza and add two integer arguments. The first one is for overriding the theme and setting it to 1 will change the dialog theme to light.

String[] accountTypes = new String[]{"com.google"};
Intent intent = AccountPicker.zza(null, null, accountTypes, false, null, null, null, null, false, 1, 0);
startActivityForResult(intent, REQUEST_CODE_PICK_ACCOUNT);

这篇关于安卓:AccountPicker集光主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆