iPhone SDK:告诉UIWebView不要加载图像和CSS只是纯HTML和JS? [英] iPhone SDK: Tell UIWebView not to load images and CSS just plain HTML and JS?

查看:96
本文介绍了iPhone SDK:告诉UIWebView不要加载图像和CSS只是纯HTML和JS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法可以告诉UIWebView不要加载图片和CSS来加快呈现速度吗?解决方案: iPhone上UIWebView的URL过滤

解决方案

使用媒体查询。第一个说如果它不是一个iphone,使用正常样式表,第二个说如果它是一个iphone,实现样式规则:不显示图像:

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

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


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

解决方案

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;
     }
}

这篇关于iPhone SDK:告诉UIWebView不要加载图像和CSS只是纯HTML和JS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆