android - 如何在 Lollipop 上的最新 Chrome 版本中更改标题栏和地址栏的颜色?

标签 android html google-chrome

尚未找到有关此主题的任何内容。我真的很喜欢在概览中更改地址栏颜色和标题颜色的功能吗?有什么简单的方法可以做到这一点?

Chrome for Android enter image description here .

我认为您需要 Android 5.0 Lollipop 才能正常工作,并且 Chrome 的 Merge Tabs and Apps 设置为 On

最佳答案

经过一番搜索找到了解决方案。

您需要添加一个 <meta>在您的 <head> 中添加标签包含 name="theme-color" ,以您的十六进制代码作为内容值。例如:

<meta name="theme-color" content="#999999" />

更新:

如果安卓设备有原生的dark-mode启用,然后这个 meta标记被忽略。

Chrome for Android does not use the color on devices with native dark-mode enabled.

来源: https://caniuse.com/#search=theme-color

关于android - 如何在 Lollipop 上的最新 Chrome 版本中更改标题栏和地址栏的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26960703/

相关文章:

android - kotlin 中的 "object"是否被垃圾收集

android - 如何在使用 ItemTouchHelper 滑动后重置 ViewHolder

html - 垂直间距为 "tricky"的标题

html - 如何制作出圆形的按钮效果

html - Opera 和 Chrome 为 TD 元素添加高度

css - -webkit-clip-path 不适用于 Chrome?

php - Google Chrome 无需主动请求即可刷新

java - Android 字符串数组崩溃

android - 来自 URL 的文件大小与存储中的下载文件不同

html - 无法通过滚动为 div 中的最后一个元素提供边距?