开发者

Does Android Web Browser shrink content like Safari on iPhone does?

开发者 https://www.devze.com 2023-02-21 07:35 出处:网络
I\'m creating a mobile versio开发者_如何学编程n of my website, for iPhone I had to use the metatag <meta name=\"viewport\" content=\"width=320; etc so that Safari would not shrink the mobile versio

I'm creating a mobile versio开发者_如何学编程n of my website, for iPhone I had to use the metatag <meta name="viewport" content="width=320; etc so that Safari would not shrink the mobile version of my site.

I'm just wondering if Android has this same functionality?

And if so, is there a similar way of telling the browser not to shrink the content

(I don't actually have an Android device or simulator to find this out for myself)


just download the android sdk ( from here: http://developer.android.com/sdk/index.html), install it and create an emulator and try it out for yourself. Should be more than enough to see how the device behaves.


Android respects the meta viewport directive like iOS, yes.


Yes, the Android browser does read meta viewport, and I recommend you change it to this:

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

Instead of setting an explicit width based on the resolution one device happens to have, the above tells the browser to use the actual width of the viewport.


The docs have pretty much on this topic: http://d.android.com/guide/webapps/index.html

0

精彩评论

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

关注公众号