ios\u6253\u5305\u6b63\u5e38\u5b89\u88c5\u5931\u8d25<\/a>HTML5 \u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210 iOS \u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n\u4e0b\u9762\u662f\u5c06 HTML5 \u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210 iOS \u5e94\u7528\u7a0b\u5e8f\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n
1. \u521b\u5efa\u4e00\u4e2a\u65b0\u7684 iOS \u9879\u76ee\uff1a\u6253\u5f00 Xcode\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 iOS \u9879\u76ee\u3002\u9009\u62e9\u201cSingle View App\u201d\u6a21\u677f\uff0c\u5e76\u586b\u5199\u76f8\u5173\u4fe1\u606f\uff08\u4f8b\u5982\u9879\u76ee\u540d\u79f0\u3001\u7ec4\u7ec7\u540d\u79f0\u7b49\uff09\u3002<\/p>\n
2. \u6dfb\u52a0 HTML5 \u6587\u4ef6\uff1a\u5728\u9879\u76ee\u5bfc\u822a\u5668\u4e2d\uff0c\u53f3\u952e\u70b9\u51fb\u201cSupporting Files\u201d\u6587\u4ef6\u5939\uff0c\u9009\u62e9\u201cAdd Files to [\u9879\u76ee\u540d\u79f0]\u201d\u9009\u9879\u3002\u9009\u62e9\u8981\u6dfb\u52a0\u7684 HTML5 \u6587\u4ef6\uff0c\u5e76\u786e\u4fdd\u5c06\u5b83\u4eec\u6dfb\u52a0\u5230\u9879\u76ee\u7684\u76ee\u6807\u4e2d\u3002<\/p>\n
3. \u914d\u7f6e\u5e94\u7528\u7a0b\u5e8f\u8bbe\u7f6e\uff1a\u6253\u5f00\u201cInfo.plist\u201d\u6587\u4ef6\uff0c\u5728\u5176\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u952e\u503c\u5bf9\u3002\u952e\u4e3a\u201cNSAppTransportSecurity\u201d\uff0c\u503c\u4e3a\u5b57\u5178\u7c7b\u578b\u3002\u5728\u8be5\u5b57\u5178\u4e2d\uff0c\u6dfb\u52a0\u952e\u503c\u5bf9\uff0c\u952e\u4e3a\u201cNSAllowsArbitraryLoads\u201d\uff0c\u503c\u4e3a\u5e03\u5c14\u7c7b\u578b\uff0c\u5e76\u5c06\u5176\u8bbe\u7f6e\u4e3a\u201cYES\u201d\u3002\u8fd9\u6837\u505a\u662f\u4e3a\u4e86\u5141\u8bb8\u5e94\u7528\u7a0b\u5e8f\u52a0\u8f7d\u6765\u81ea\u4e8e\u4efb\u4f55\u57df\u7684\u6570\u636e\u3002<\/p>\n
4. \u8bbe\u7f6e\u542f\u52a8\u9875\uff1a\u5728\u9879\u76ee\u5bfc\u822a\u5668\u4e2d\uff0c\u627e\u5230\u201cAssets.xcassets\u201d\u6587\u4ef6\u5939\u5e76\u5c55\u5f00\u3002\u5c06 HTML5 \u5e94\u7528\u7a0b\u5e8f\u7684\u542f\u52a8\u9875\u56fe\u7247\u6dfb\u52a0\u5230\u8fd9\u4e2a\u6587\u4ef6\u5939\u4e2d\u3002\u786e\u4fdd\u56fe\u7247\u7684\u547d\u540d\u4e3a\u201cLaunchImage\u201d\u3002<\/p>\n
5. \u8c03\u6574\u5e94\u7528\u7a0b\u5e8f\u754c\u9762\uff1a\u5728\u201cMain.storyboard\u201d\u6587\u4ef6\u4e2d\uff0c\u8c03\u6574\u89c6\u56fe\u63a7\u5236\u5668\u7684\u754c\u9762\uff0c\u4ee5\u9002\u5e94 HTML5 \u5e94\u7528\u7a0b\u5e8f\u7684\u5c55\u793a\u3002\u53ef\u4ee5\u6dfb\u52a0\u4e00\u4e2a\u201cUIWebView\u201d\u63a7\u4ef6\uff0c\u5e76\u8bbe\u7f6e\u5176\u7ea6\u675f\u4ee5\u9002\u5e94\u5c4f\u5e55\u5927\u5c0f\u3002<\/p>\n
6. \u914d\u7f6e\u5e94\u7528\u7a0b\u5e8f\u7684\u4fe1\u606f\u548c\u56fe\u6807\uff1a\u5728\u9879\u76ee\u5bfc\u822a\u5668\u4e2d\uff0c\u627e\u5230\u201cInfo.plist\u201d\u6587\u4ef6\uff0c\u5e76\u914d\u7f6e\u5e94\u7528\u7a0b\u5e8f\u7684\u540d\u79f0\u3001\u7248\u672c\u53f7\u548c\u56fe\u6807\u7b49\u4fe1\u606f\uff0c\u4ee5\u4fbf\u5728 App Store \u4e0a\u663e\u793a\u3002<\/p>\n
7. \u6784\u5efa\u548c\u8fd0\u884c\uff1a\u5728 Xcode \u7684\u9876\u90e8\u5de5\u5177\u680f\u4e2d\uff0c\u9009\u62e9\u5408\u9002\u7684\u76ee\u6807\u8bbe\u5907\uff08\u4f8b\u5982 iPhone \u6216 iPad\uff09\uff0c\u7136\u540e\u70b9\u51fb\u201cBuild and Run\u201d\u6309\u94ae\u3002Xcode \u5c06\u4f1a\u6784\u5efa\u5e76\u8fd0\u884c\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n
\u8fd9\u5c31\u662f\u5c06 HTML5 \u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210 iOS \u5e94\u7528\u7a0b\u5e8f\u7684\u5927\u81f4\u6b65\u9aa4\u3002\u5f53\u7136\uff0c\u8fd9\u53ea\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff0c\u4f60\u8fd8\u53ef\u4ee5\u8fdb\u884c\u66f4\u591a\u7684\u914d\u7f6e\u548c<\/p>\n
<\/figure>\n<\/p>\n\u8c03\u6574\uff0c\u4ee5\u9002\u5e94\u4f60\u7684\u5177\u4f53\u9700\u6c42\u3002<\/p>\n
\u5c06 HTML5 \u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210 iOS \u5e94\u7528\u7a0b\u5e8f\u7684\u539f\u7406\u662f\u901a\u8fc7\u5728 iOS \u5e94\u7528\u7a0b\u5e8f\u4e2d\u5d4c\u5165\u4e00\u4e2a UIWebView \u6765\u52a0\u8f7d\u548c\u8fd0\u884c HTML5 \u5185\u5bb9\u3002UIWebView \u662f\u4e00\u4e2a\u53ef\u4ee5\u52a0\u8f7d\u548c\u663e\u793a\u7f51\u9875\u5185\u5bb9\u7684\u63a7\u4ef6\uff0c\u5b83\u53ef\u4ee5\u901a\u8fc7\u52a0\u8f7d HTML5 \u6587\u4ef6\uff0c\u5e76\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u5448\u73b0\u51fa\u6765\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4f7f\u7528\u539f\u751f\u7684 iOS \u63a7\u4ef6\u548c\u529f\u80fd\uff0c\u540c\u65f6\u5c55\u793a HTML5 \u5e94\u7528\u7a0b\u5e8f\u7684\u5185\u5bb9\u3002<\/p>\n
\u603b\u7ed3\u8d77\u6765\uff0c\u5c06 HTML5 \u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210 iOS \u5e94\u7528\u7a0b\u5e8f\u9700\u8981\u4f7f\u7528 Xcode \u6765\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\uff0c\u5e76\u5728\u5176\u4e2d\u6dfb\u52a0 HTML5 \u6587\u4ef6\u3002\u7136\u540e\uff0c\u914d\u7f6e\u5e94\u7528\u7a0b\u5e8f\u7684<\/p>\n","protected":false},"excerpt":{"rendered":"
iOS \u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u79fb\u52a8\u64cd\u4f5c\u7cfb\u7edf\uff0c\u652f\u6301\u5f00\u53d1\u548c\u8fd0\u884c\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u3002\u7136\u800c\uff0c\u6709\u65f6\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5c06\u57fa\u4e8e HTML5 \u7684\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210 iOS \u5e94\u7528\u7a0b\u5e8f\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5c06 HTML5 \u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3a iOS \u5e94\u7528<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[10026,10055,12,16,23],"topic":[],"class_list":["post-5352","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-iosipa","tag-ios","tag-12","tag-16","tag-23"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/5352","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=5352"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/5352\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=5352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=5352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=5352"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=5352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}