Android WebView seems to ignore “viewport” information on web pages

后端 未结 8 2221
情深已故
情深已故 2020-12-15 00:37

I have a website that is using the viewport META tag to tell mobile browsers how to display content ( ). Viewing the page in the Android browser looks correct (and iPhone,

8条回答
  •  春和景丽
    2020-12-15 01:02

    After lot's of experimentation I've determined that the Android WebView won't obey the 'viewport' setting if the actual page forces a width wider than the viewport setting.

    For example, I was setting a viewport of 500px, but had an element on my page that forced a 960px width. The viewport wasn't obeyed because the WebView refused to hide that extra content.

    This seems obvious when I'm typing it, but I must have spent days working on the problem.

提交回复
热议问题