iPhone SDK: Tell UIWebView not to load images and CSS just plain HTML and JS?

半城伤御伤魂 提交于 2019-12-11 16:58:21

问题


Is there any way to tell a UIWebView not to load images and CSS for faster rendering?

Solution: URL filtering for UIWebView on the iPhone


回答1:


Use media queries. The first one says "if it is not an iphone, use the normal style sheet", the second says "if it is an iphone, implement style rule: don't display images" :

<link type="text/css" rel="stylesheet" media="not (max-device-width: 480px)" href="normalstyle.css">

<style type="text/css">
@media (max-device-width: 480px) {
     img {
       display: none;
     }
}


来源:https://stackoverflow.com/questions/2067943/iphone-sdk-tell-uiwebview-not-to-load-images-and-css-just-plain-html-and-js

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