学科:IOS/KB/移动页面常用参考
外观
< Subject:IOS | KB
例:
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
例:
@media screen and (max-device-width: 480px) {}
例:
<link rel="stylesheet" media="screen and (max-width: 320px)" href="portrait.css" /> <link rel="stylesheet" media="screen and (min-width: 321px)" href="landscape.css" /> <link rel="stylesheet" media="screen and (orientation:portrait)" href="portrait.css" /> <link rel="stylesheet" media="screen and (orientation:landscape)" href="landscape.css" />
- 旋转屏幕时自动调整字体大小
- 可用值:none | auto(默认) | <percentage>
- 控制用户是否可以选择元素
- 可用值:auto | none | text
- 默认长按链接会弹出一选择菜单,可选择打开还是拷贝链接
- 可用值:default | none | inherit
- 设置可点击元素的高亮颜色
- 可用值:<color>
详见:Safari Web Content Guide > Handling Events
window.orientation
例:
<link rel="apple-touch-icon" href="icon_url.png" /> <link rel="apple-touch-icon-precomposed" href="icon_url_has_highlight.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />
iOS 6 上需设置 http header 的 Cache-Control 为 no-cache 才能阻止请求被缓存。
详见: http://stackoverflow.com/q/12506897
- 官方文档:Safari Web Content Guide
- http://pattern.dk/sun/ —— 经典天气Web App
- A Primer on Hybrid Apps for iOS - Cocoa Controls
- Swift Example
- 淘宝移动端Web开发最佳实践
- Understanding the iOS6 AJAX bugs - Guillermo Rauch
- iOS Webapp的桌面图标及更新 http://himeters.com/update-ios-webapp-touch-icon
- Hide the Address Bar within Mobile Web Applications http://davidwalsh.name/hide-address-bar