CSS not rendering correctly on iOS 7.x when I use 'vw' metric with Ionic (PhoneGap)

て烟熏妆下的殇ゞ 提交于 2021-01-27 06:25:29

问题


I'm making an app using Ionic Framework, which is based upon PhoneGap.

I'm using 'vw' metric for several properties to make them resizable for all the devices, either iOS or Android. When I run on my browser with the 'ionic serve' option and the iOS Simulator for the 8.1 version I get the expected result, but when I run on iOS 7.1 Simulator, all the - and ONLY the - border related properties don't get rendered.

Any idea on how to solve this?

Thanks!


回答1:


Viewport units doesn't work well on iOS 7 caniuse.com

Partial support in iOS7 is due to buggy behavior of the "vh" unit.

known issues:

  1. Chrome does not support viewport units for border widths, column gaps, transform values, box shadows or in calc() until version 34.
  2. iOS Safari (both 6 and 7) does not support viewport units for border widths, column gaps, transform values, box shadows or in calc().
  3. iOS 7 Safari sets viewport unit values to 0 if the page has been left and is returned to after 60 seconds.
  4. Internet Explorer 9 in print-mode interprets vh as pages. 30vh = 30 pages
  5. iOS 7 Safari recalculates widths set in vh as vw, and heights set in vw as vh, when orientation changes.

More info about the buggy behavior

http://blog.rodneyrehm.de/archives/34-iOS7-Mobile-Safari-And-Viewport-Units.html

And a polyfill https://github.com/rodneyrehm/viewport-units-buggyfill



来源:https://stackoverflow.com/questions/27976847/css-not-rendering-correctly-on-ios-7-x-when-i-use-vw-metric-with-ionic-phoneg

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!