{"id":5214,"date":"2023-09-20T12:33:42","date_gmt":"2023-09-20T04:33:42","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=5214"},"modified":"2023-09-20T12:33:42","modified_gmt":"2023-09-20T04:33:42","slug":"html-%e6%89%93%e5%8c%85ios%e6%93%8d%e4%bd%9c%e6%ad%a5%e9%aa%a4%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/5214\/","title":{"rendered":"html \u6253\u5305ios\u64cd\u4f5c\u6b65\u9aa4\u4ecb\u7ecd"},"content":{"rendered":"

HTML\u6253\u5305iOS\u4e3b\u8981\u662f\u6307\u5229\u7528HTML\u3001CSS\u548cJavaScript\u7b49\u524d\u7aef\u6280\u672f\u6765\u5f00\u53d1iOS\u5e94\u7528\u7a0b\u5e8f\u3002\u8fd9\u79cd\u65b9\u5f0f\u79f0\u4e3a\u6df7\u5408\u5f00\u53d1\uff0c\u5b83\u5c06\u7f51\u9875\u6280\u672f\u548c\u539f\u751f\u5e94\u7528\u7ed3\u5408\u8d77\u6765\uff0c\u53ef\u4ee5\u5feb\u901f\u5f00\u53d1\u8de8\u5e73\u53f0\u5e94\u7528\u3002<\/p>\n

\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecdHTML\u6253\u5305iOS\u7684\u539f\u7406\u548c\u6b65\u9aa4\u3002<\/p>\n

1. \u539f\u7406<\/p>\n

HTML\u6253\u5305iOS\u7684\u539f\u7406\u662f\u901a\u8fc7\u4f7f\u7528\u4e00\u4e9b\u5de5\u5177\u548c\u6846\u67b6\uff0c\u5c06HTML\u3001CSS\u548cJavaScript\u7b49\u524d\u7aef\u8d44\u6e90\u6253\u5305\u6210\u4e00\u4e2aiOS\u5e94\u7528\u7a0b\u5e8f\u3002\u8fd9\u4e2a\u5e94\u7528\u7a0b\u5e8f\u5728iOS\u8bbe\u5907\u4e0a\u8fd0\u884c\u65f6\uff0c\u4f1a\u5c06\u7f51\u9875\u5448\u73b0\u5728\u4e00\u4e2a\u5185\u7f6e\u7684Web\u89c6\u56fe\u4e2d\uff0c\u5b9e\u73b0\u7f51\u9875\u5728iOS\u8bbe\u5907\u4e0a\u7684\u5c55\u793a\u548c\u4ea4\u4e92\u3002<\/p>\n

2. \u6b65\u9aa4<\/p>\n

2.1 \u51c6\u5907\u5de5\u4f5c<\/p>\n

\u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u5f00\u53d1\u5de5\u5177\u548c\u73af\u5883\uff0c\u5982Xcode\u3001Node.js\u3001Cordova\u7b49\u3002\u8fd9\u4e9b\u5de5\u5177\u548c\u73af\u5883\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u8fdb\u884c\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\u548c\u6253\u5305\u3002<\/p>\n

2.2 \u521b\u5efa\u9879\u76ee<\/p>\n

\u4f7f\u7528Cordova\u547d\u4ee4\u884c\u5de5\u5177\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n

“`<\/p>\n

cordova create myApp com.example.myApp MyApp<\/p>\n

“`<\/p>\n

\u5176\u4e2d\uff0cmyApp\u8868\u793a\u9879\u76ee\u7684\u540d\u79f0\uff0ccom.example.myApp\u8868\u793a\u5e94\u7528\u7a0b\u5e8f\u7684\u5305\u540d\uff0cMyApp\u8868\u793a\u5e94\u7528\u7a0b\u5e8f\u7684\u6807\u9898\u3002<\/p>\n

2.3 \u6dfb\u52a0\u5e73\u53f0<\/p>\n

\u8fdb\u5165\u5230\u9879\u76ee\u7684\u76ee\u5f55\uff0c\u4f7f\u7528Cordova\u547d\u4ee4\u884c\u5de5\u5177\u6dfb\u52a0\u9700\u8981\u6253\u5305\u7684\u5e73\u53f0\uff0c\u5982iOS\u5e73\u53f0\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n

“`<\/p>\n

cd myApp<\/p>\n

cordova platform add ios<\/p>\n

“`<\/p>\n

2.4 \u7f16\u5199\u4ee3\u7801<\/p>\n

\u5728\u9879\u76ee\u7684www\u76ee\u5f55\u4e0b\u7f16\u5199HTML\u3001CSS\u548cJavaScript\u7b49\u524d\u7aef\u4ee3\u7801\uff0c\u5b9e\u73b0\u5e94\u7528\u7a0b\u5e8f\u7684\u529f\u80fd\u548c\u754c\u9762\u3002<\/p>\n

2.5 \u6784\u5efa\u9879\u76ee<\/p>\n

\u4f7f\u7528Cordova\u547d\u4ee4\u884c\u5de5\u5177\u8fdb\u884c\u9879\u76ee\u7684\u6784\u5efa\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n

`\u65e9\u4e0a\u63d0\u4ea4ios\u7684\u4e91\u7aef\u6253\u5305<\/a>“<\/p>\n

cordova build ios<\/p>\n

“`<\/p>\n

\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u5c06\u524d\u7aef\u8d44\u6e90\u6253\u5305\u6210\u4e00\u4e2aiOS\u9879\u76ee\u7684\u6587\u4ef6\u7ed3\u6784\u3002<\/p>\n

2.6 \u6253\u5305\u5e94\u7528\u7a0b\u5e8f<\/p>\n

\u4f7f\u7528Xcode\u6253\u5f00\u9879\u76ee\u7684platforms\/ios\u76ee\u5f55\u4e0b\u7684.xcodeproj\u6587\u4ef6\uff0c\u8fdb\u5165Xcode\u754c\u9762\u540e\uff0c\u9009\u62e9\u5bf9\u5e94\u7684\u8bbe\u5907\u548c\u8bc1\u4e66\uff0c\u70b9\u51fbBuild\u6309\u94ae\u8fdb\u884c\u5e94\u7528\u7a0b\u5e8f\u7684\u6253\u5305\u3002<\/p>\n

3. \u6ce8\u610f\u4e8b\u9879<\/p>\n

\u5728HTML\u6253\u5305iOS\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n

– \u8003\u8651\u79fb\u52a8\u8bbe\u5907\u7684\u6027\u80fd\u548c\u9002\u914d\u6027\uff0c\u5728\u7f16\u5199\u524d\u7aef\u4ee3\u7801\u65f6\uff0c\u8981\u6ce8\u610f\u4f18\u5316\u548c\u79fb\u52a8\u8bbe\u5907\u7684\u517c\u5bb9\u6027\u3002<\/p>\n

– \u5728\u6253\u5305\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u9009\u62e9\u5408\u9002\u7684\u8bbe\u5907\u548c\u8bc1\u4e66\uff0c\u4ee5\u53ca\u8bbe\u7f6e\u5e94\u7528\u7a0b\u5e8f\u7684\u56fe\u6807\u548c\u542f\u52a8\u753b\u9762\u7b49\u3002<\/p>\n

– \u5728\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\u548c\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u6a21\u62df\u5668\u8fdb\u884c\u6d4b\u8bd5\uff0c\u4f46\u6700\u7ec8\u53d1\u5e03\u65f6\u9700\u8981\u5728\u771f\u5b9e\u8bbe\u5907\u4e0a\u8fdb\u884c\u6d4b\u8bd5\uff0c\u4ee5\u786e\u4fdd\u5e94\u7528\u7a0b<\/p>\n

<\/figure>\n<\/p>\n

\u5e8f\u7684\u7a33\u5b9a\u6027\u548c\u6027\u80fd\u3002<\/p>\n

\u603b\u7ed3\uff1a<\/p>\n

HTML\u6253\u5305iOS\u662f\u4e00\u79cd\u5feb\u901f\u5f00\u53d1ios\u6253\u5305\u5b8c<\/a>\u8de8\u5e73\u53f0\u5e94\u7528\u7684\u65b9\u5f0f\uff0c\u901a\u8fc7\u5c06HTML\u3001CSS\u548cJavaScript\u7b49\u524d\u7aef\u8d44\u6e90\u6253\u5305\u6210\u4e00\u4e2aiOS\u5e94\u7528\u7a0b\u5e8f\uff0c\u5b9e\u73b0\u7f51\u9875\u5728iOS\u8bbe\u5907\u4e0a\u7684\u5c55\u793a\u548c\u4ea4\u4e92\u3002\u901a\u8fc7\u5148\u51c6\u5907\u5de5\u4f5c\u3001\u521b\u5efa\u9879\u76ee\u3001\u6dfb\u52a0\u5e73\u53f0\u3001\u7f16\u5199\u4ee3\u7801\u3001\u6784\u5efa\u9879\u76ee\u548c\u6253\u5305\u5e94\u7528\u7a0b\u5e8f\u7b49\u6b65\u9aa4\uff0c\u53ef\u4ee5\u5c06HTML\u6253\u5305\u6210\u4e00\u4e2aiOS\u5e94\u7528\u7a0b\u5e8f\u3002\u4f46\u9700\u8981\u6ce8\u610f\u79fb\u52a8\u8bbe\u5907\u7684\u6027\u80fd\u548c\u9002\u914d\u6027\uff0c\u9009\u62e9\u5408\u9002\u7684\u8bbe\u5907\u548c\u8bc1\u4e66\uff0c\u4ee5\u53ca\u5728\u771f\u5b9e\u8bbe\u5907\u4e0a\u8fdb\u884c\u6d4b\u8bd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

HTML\u6253\u5305iOS\u4e3b\u8981\u662f\u6307\u5229\u7528HTML\u3001CSS\u548cJavaScript\u7b49\u524d\u7aef\u6280\u672f\u6765\u5f00\u53d1iOS\u5e94\u7528\u7a0b\u5e8f\u3002\u8fd9\u79cd\u65b9\u5f0f\u79f0\u4e3a\u6df7\u5408\u5f00\u53d1\uff0c\u5b83\u5c06\u7f51\u9875\u6280\u672f\u548c\u539f\u751f\u5e94\u7528\u7ed3\u5408\u8d77\u6765\uff0c\u53ef\u4ee5\u5feb\u901f\u5f00\u53d1\u8de8\u5e73\u53f0\u5e94\u7528\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecdHTM<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[8917,9825,12,56,23],"topic":[],"class_list":["post-5214","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-iosapp","tag-iosrn","tag-12","tag-56","tag-23"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/5214","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\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=5214"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/5214\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=5214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=5214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=5214"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=5214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}