【发布时间】:2018-06-16 02:42:52
【问题描述】:
我正在使用 Chrome 自定义标签在我的应用中显示网页内容。显然,这样做的主要优点之一是能够更改选项卡中的 UI 颜色。但是,我需要将状态栏颜色更改为我提供的原色的较暗版本。
有没有办法做到这一点?
作为参考,这是我的代码。
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
builder.setToolbarColor(getResources().getColor(R.color.colorPrimary));
builder.setSecondaryToolbarColor(getResources().getColor(R.color.colorPrimary));
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(MainActivity.this, Uri.parse(url));
您可能已经猜到了,我想将状态栏颜色更改为R.color.colorPrimary,而不是自动选择的颜色。
非常感谢任何帮助
【问题讨论】:
标签: android chrome-custom-tabs