![](/img/trans.png)
[英]iOS 7 UINavigationController transition to UITableView: black-translucent layer during animation
[英]WebApp on iPhone with black-translucent StatusBar: Viewport height seems to be wrong
我目前遇到的问题是,当我使用状态栏样式black-translucent
时,我的 iPhone 没有将内容显示到网络应用程序的屏幕底部。
底部总是有一个缺口。
我使用一个简单的页脚栏创建了一个最小的示例来演示它:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover"> <style> body { background-color: DarkGray; } #footer { position: fixed; left: 0; bottom: 0; width: 100%; height: 54px; background-color: DimGray; } </style> <title>Test</title> </head> <body> <div id="content"></div> <div id="footer"></div> </body> </html>
该问题仅在 iPhone 纵向出现,并且仅在将应用程序保存到主屏幕时才会出现,因此它会全屏运行。 桌面浏览器也可以正确呈现页面。
这是它在 iPhone 上的外观截图(通常较深的灰色条应直接位于底部):
知道这里到底发生了什么以及如何解决吗?
好的,似乎只有当页面内容没有垂直填充整个空间直到页脚时才会发生这种情况。
一些用于放大内容的 CSS 将解决此问题:
#content {
min-height: 100vh;
padding-bottom: 54px;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.