英文:
Site showing white background behind status bar on iOS
问题
我在iOS设备上的网站上遇到了状态栏颜色的问题。背景颜色似乎被忽略了,在我的iOS设备上状态栏后面有一个白色的条。我尝试过使用HSL颜色标签设置theme-color和apple-mobile-web-app-status-bar-style的meta标签,但它们似乎没有起作用。当我最小化页面,然后打开另一个选项卡并返回时,有时状态栏后面的背景变成了正确的颜色,并且像我希望的那样工作。
网站上的代码。
英文:
Im having trouble with the status bar color on my website for iOS device. The background color seems to be ignored and there is a white bar behind the status bar on my ios device. I’ve tried setting up theme-color and apple-mobile-web-app-status-bar-style meta tags with HSL color tags but they don’t seem to do anything. When I minimize the page and open another tab and come back to it, sometimes the background behind the status bar becomes the correct color and works like I would like it to.
Does anyone have any ideas for how I can fix this?
bad example
good example
Code on website.
答案1
得分: 0
通过将background-color
属性添加到html
元素来解决。当样式仅应用于body
时,状态栏后面和导航栏下面的区域会变为白色且可拖动。
英文:
Solved by adding the background-color
property to the html
element.
when the style was only applied to the body the area behind the status bar and under the navigation bar would be white and draggable
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论