Html ios 10 中的 apple-mobile-web-app-status-bar-style
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39749015/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
apple-mobile-web-app-status-bar-style in ios 10
提问by Brad
I know this question has been asked previously, just want to know if this is still the case in ios 10 (and ios 9)...
我知道之前有人问过这个问题,只是想知道在 ios 10(和 ios 9)中是否仍然如此......
According to the apple developer guidelines for web apps (found here), there are 3 choices for the status bar in a web app; default, blackand black-translucent.
根据 Apple 网络应用程序开发者指南(可在此处找到),网络应用程序中的状态栏有 3 种选择;默认,黑色和黑色半透明。
- Defaultresults in a white status bar with black text,
- Blackresults in a black status bar with white text, and
- Black-translucentresults in a transparent background with white text. Additionally, this status bar floats above your content, meaning you have to push your content down 20px in order to not have the content overlap with thte status bar text.
- 默认导致带有黑色文本的白色状态栏,
- 黑色导致带有白色文本的黑色状态栏,以及
- 黑色半透明导致带有白色文本的透明背景。此外,此状态栏浮动在您的内容上方,这意味着您必须将内容向下推 20 像素,以免内容与状态栏文本重叠。
I'd really like to use the black-translucent status bar (as I think it looks more native), but the background of my page is a light grey. This makes the white text on this status bar very hard to read.
我真的很想使用黑色半透明状态栏(因为我认为它看起来更原生),但我页面的背景是浅灰色。这使得此状态栏上的白色文本很难阅读。
Put simply, I'd just like a transparent background with black text (essentially, default-translucent). Is this possible?
简而言之,我只想要一个带有黑色文本的透明背景(本质上是default-translucent)。这可能吗?
回答by Matt
Unfortunately, No you cannot have black text on a transparent background.
不幸的是,不,您不能在透明背景上使用黑色文本。
I'm of the opinion that this will be added to the schema at some point and also find it a pain that you can't achieve this example right now. I guess in short the answer is design your faux app natively to achieve greater control of its behaviour and appearance.
我认为这将在某个时候添加到模式中,并且发现您现在无法实现此示例是一种痛苦。我想简而言之,答案是在本地设计您的人造应用程序,以更好地控制其行为和外观。
Apple DocumentationSupported Meta Tags
Apple 文档支持的 Meta 标签
content="default"
content="default"
content="black"
content="black"
content="black-translucent"
content="black-translucent"
回答by AlexChaseJones
It currently isn't possible. I just wanted to add (after reading a comment) that in order for the changes to show up, at least on my iphone X, you will need to delete the app from your phone then re-add it to the home screen.
目前是不可能的。我只是想补充一下(在阅读评论后)为了显示更改,至少在我的 iphone X 上,您需要从手机中删除该应用程序,然后将其重新添加到主屏幕。