开发者

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

开发者 https://www.devze.com 2022-12-16 16:42 出处:网络
Is ther开发者_如何学运维e any way to tell a UIWebView not to load images and CSS for faster rendering?

Is ther开发者_如何学运维e 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;
     }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消