6.移动端速查


🐂第一部分:HTML5混生开发

1.移动端适配方案(rem)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<style>
    * {
        padding: 0;
        margin: 0;
    }
    html,body {
        width: 100%;
        height: 100%;
    }
    .rem-test {
        background: blue;
        width: 100%;
        height: 100%;
    }
</style>
<body>
    
    <div class="rem-test"></div>
    <script>
        !(function(win, doc) {
            var htmlDom = doc.getElementsByTagName('html')[0];
            var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
            var recalc = function() {
                var htmlWidth = doc.documentElement.clientWidth || doc.body.clientWidth;
                htmlDom.style.fontSize = htmlWidth / 10 + 'px';
            };

            if (!doc.addEventListener) return;
            win.addEventListener(resizeEvt, recalc, false);
            doc.addEventListener('DOMContentLoaded', recalc, false);
        }(window, document));
    </script>
</body>
</html>

🐪第二部分:微信小程序


🦏第三部分:Flutter


🐘第四部分:React-Native


🐑第五部分:移动端原生开发


📚参考列表(致敬)