[英]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.