首页 > 解决方案 > Chrome 自定义标签颜色变化

问题描述

如何更改条形阴影、标题文本和进度条的颜色,如 Twitter(https://imgur.com/a/n0Rcbej)或 Telegram(https://imgur.com/a/U9QLiwR )的 Android 应用程序)?

这是我的应用程序(https://imgur.com/a/KGiLR9t

我无法将标记元添加到 html。不使用标签怎么办?

CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
            builder.setToolbarColor(ResourcesCompat.getColor(getResources(), R.color.blue, null));
            builder.enableUrlBarHiding();
            CustomTabsIntent customTabsIntent = builder.build();
            customTabsIntent.launchUrl(this, Uri.parse(url));

标签: androidgoogle-chromechrome-custom-tabs

解决方案


设置 bar-shadow 颜色是不可能的,你可以设置颜色栏,它们将被填充为纯色,但不是所有颜色。我发现只有 3 种纯色:白色(#ffffff),如 twitter,黑色(#000000)和蓝色(#4d7f9e),如电报。


推荐阅读