{"id":88370,"date":"2026-08-01T02:56:40","date_gmt":"2026-07-31T18:56:40","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/88370.html"},"modified":"2026-08-01T02:56:40","modified_gmt":"2026-07-31T18:56:40","slug":"%e3%80%90%e7%ac%94%e4%b8%8b%e7%94%9f%e8%be%89%ef%bd%9c16%e3%80%91harmonyos-arkts-%e5%a4%9a%e8%ae%be%e5%a4%87%e5%b8%83%e5%b1%80%e5%ae%9e%e6%88%98%ef%bc%9a%e9%80%82%e9%85%8d%e6%89%8b%e6%9c%ba%e3%80%81","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/88370.html","title":{"rendered":"\u3010\u7b14\u4e0b\u751f\u8f89\uff5c16\u3011HarmonyOS ArkTS \u591a\u8bbe\u5907\u5e03\u5c40\u5b9e\u6218\uff1a\u9002\u914d\u624b\u673a\u3001\u5e73\u677f\u548c PC\/2in1 \u7684\u7a97\u53e3\u53d8\u5316"},"content":{"rendered":"<p>\u5b9e\u9645\u505a HarmonyOS 5.0&#043; \u5e94\u7528\u65f6&#xff0c;\u591a\u8bbe\u5907\u9002\u914d\u6700\u5bb9\u6613\u51fa\u95ee\u9898\u7684\u5730\u65b9\u4e0d\u662f\u201c\u6709\u6ca1\u6709\u5199\u54cd\u5e94\u5f0f\u5e03\u5c40\u201d\u8fd9\u53e5\u8bdd&#xff0c;\u800c\u662f\u7a97\u53e3\u53d8\u5316\u53d1\u751f\u4ee5\u540e&#xff0c;\u9875\u9762\u5230\u5e95\u7531\u8c01\u611f\u77e5\u3001\u8c01\u4fdd\u5b58\u72b6\u6001\u3001\u8c01\u51b3\u5b9a\u5e03\u5c40\u3001\u8c01\u5904\u7406\u5b89\u5168\u533a\u3002\u7b14\u4e0b\u751f\u8f89\u8fd9\u5957\u6e90\u7801\u628a\u9002\u914d\u62c6\u6210\u4e86\u4e09\u4e2a\u53ef\u590d\u6838\u7684\u70b9&#xff1a;BreakpointSystem \u7528 mediaquery \u4ea7\u51fa sm\u3001md\u3001lg \u65ad\u70b9&#xff0c;EntryAbility \u628a\u9876\u90e8\u548c\u5e95\u90e8\u907f\u8ba9\u533a\u5199\u8fdb AppStorage&#xff0c;\u5404\u9875\u9762\u518d\u7ed3\u5408 &#064;StorageLink \u4e0e onAreaChange \u51b3\u5b9a\u5217\u8868\u3001\u7f51\u683c\u3001\u5bbd\u5c4f\u8be6\u60c5\u548c\u5e95\u90e8\u5bfc\u822a\u7684\u8868\u73b0\u3002<\/p>\n<p>\u672c\u6587\u53ea\u8ba8\u8bba\u6e90\u7801\u4e2d\u5df2\u7ecf\u5b58\u5728\u3001\u53ef\u4ee5\u9010\u884c\u590d\u6838\u7684\u5b9e\u73b0\u3002\u9879\u76ee\u5305\u540d\u6807\u8bb0\u4e3a com.jiaweikang.one17\u3002\u9700\u8981\u5148\u8bf4\u660e\u8fb9\u754c&#xff1a;\u5f53\u524d Index.ets \u867d\u7136\u4fdd\u7559\u4e86\u4fa7\u8fb9\u5bfc\u822a\u5206\u652f&#xff0c;\u4f46\u5b83\u7684\u6761\u4ef6\u628a sm\u3001md\u3001lg \u90fd\u5f52\u5165\u5e95\u90e8\u5bfc\u822a\u5206\u652f&#xff1b;\u7531\u4e8e BreakpointSystem \u53ea\u4f1a\u5199\u5165\u8fd9\u4e09\u4e2a\u503c&#xff0c;\u6240\u4ee5\u4fa7\u8fb9\u5bfc\u822a\u5206\u652f\u5728\u5f53\u524d\u4ee3\u7801\u4e0b\u4e0d\u4f1a\u88ab\u89e6\u8fbe\u3002\u8fd9\u4e2a\u70b9\u5f88\u91cd\u8981&#xff0c;\u56e0\u4e3a\u5b83\u51b3\u5b9a\u4e86\u672c\u6587\u4e0d\u80fd\u628a\u201c\u5df2\u5b8c\u6210 PC \u4fa7\u8fb9\u680f\u5bfc\u822a\u5207\u6362\u201d\u5f53\u6210\u65e2\u6709\u80fd\u529b&#xff0c;\u53ea\u80fd\u628a\u5b83\u4f5c\u4e3a\u6e90\u7801\u5ba1\u67e5\u4e2d\u53d1\u73b0\u7684\u540e\u7eed\u4f18\u5316\u9879\u3002<\/p>\n<p><img decoding=\"async\" alt=\"\u591a\u8bbe\u5907\u5e03\u5c40\u5c01\u9762\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260731185637-6a6cefe5aae03.png\" \/><\/p>\n<h3>1. \u8fd9\u7bc7\u6587\u7ae0\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898<\/h3>\n<p>\u7b14\u4e0b\u751f\u8f89\u662f\u4e00\u4e2a\u9762\u5411\u5ba2\u5bb6\u8c1a\u8bed\u3001\u5206\u7c7b\u3001\u9898\u5e93\u548c\u5b66\u4e60\u7edf\u8ba1\u7684 HarmonyOS \u5e94\u7528\u3002\u5b83\u7684\u9875\u9762\u4e0d\u53ea\u662f\u7b80\u5355\u5217\u8868&#xff1a;\u9996\u9875\u6709\u5206\u7c7b\u5165\u53e3\u548c\u63a8\u8350\u5185\u5bb9&#xff0c;\u8c1a\u8bed\u5217\u8868\u5728\u5bbd\u5c4f\u4e0b\u9700\u8981\u4ece\u5355\u5217\u53d8\u6210\u591a\u5217&#xff0c;\u8be6\u60c5\u9875\u5728\u5927\u7a97\u53e3\u4e0b\u8981\u62c9\u5f00\u4fe1\u606f\u533a\u548c\u5185\u5bb9\u533a&#xff0c;\u5206\u7c7b\u9875\u9700\u8981\u6839\u636e\u5bb9\u5668\u5bbd\u5ea6\u6539\u53d8\u5361\u7247\u6bd4\u4f8b&#xff0c;\u8003\u8bd5\u7ed3\u679c\u9875\u548c\u4e3b\u5bfc\u822a\u8fd8\u8981\u907f\u5f00\u7cfb\u7edf\u5e95\u90e8\u624b\u52bf\u533a\u3002\u628a\u8fd9\u4e9b\u9700\u6c42\u6df7\u5728\u5355\u4e2a\u9875\u9762\u91cc\u786c\u5199&#xff0c;\u4f1a\u5f97\u5230\u4e00\u5806\u96be\u7ef4\u62a4\u7684 if&#xff1b;\u6e90\u7801\u91cc\u66f4\u7a33\u5b9a\u7684\u505a\u6cd5&#xff0c;\u662f\u628a\u8bbe\u5907\u7ea7\u65ad\u70b9\u3001\u5bb9\u5668\u7ea7\u5bbd\u5ea6\u3001\u5b89\u5168\u533a\u8fd9\u4e09\u7c7b\u4fe1\u53f7\u5206\u5f00\u3002<\/p>\n<p>\u672c\u6587\u4f1a\u6309\u771f\u5b9e\u4ee3\u7801\u68b3\u7406\u56db\u4e2a\u95ee\u9898&#xff1a;<\/p>\n<table>\n<tr>\u95ee\u9898\u6e90\u7801\u91cc\u7684\u627f\u62c5\u8005\u590d\u6838\u6587\u4ef6<\/tr>\n<tbody>\n<tr>\n<td>\u7a97\u53e3\u5bbd\u5ea6\u843d\u5728\u54ea\u4e2a\u65ad\u70b9<\/td>\n<td>BreakpointSystem.register()<\/td>\n<td>libraryb\/src\/main\/ets\/utils\/BreakpointSystem.ets<\/td>\n<\/tr>\n<tr>\n<td>\u65ad\u70b9\u5982\u4f55\u8de8\u9875\u9762\u5171\u4eab<\/td>\n<td>AppStorage.setOrCreate(&#039;currentBreakpoint&#039;, bp)<\/td>\n<td>BreakpointSystem.ets<\/td>\n<\/tr>\n<tr>\n<td>\u9876\u90e8\u548c\u5e95\u90e8\u5b89\u5168\u533a\u5982\u4f55\u8fdb\u5165\u9875\u9762<\/td>\n<td>EntryAbility.updateTopAvoidAreaHeight() \/ updateNavigationIndicatorHeight()<\/td>\n<td>entry\/src\/main\/ets\/entryability\/EntryAbility.ets<\/td>\n<\/tr>\n<tr>\n<td>\u9875\u9762\u600e\u6837\u5207\u6362\u5e03\u5c40<\/td>\n<td>&#064;StorageLink\u3001onAreaChange\u3001useGridLayout()\u3001useWideLayout()<\/td>\n<td>Index.ets\u3001BankListPage.ets\u3001BankDetailPage.ets\u3001CategoryPage.ets<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u5957\u5206\u5de5\u7684\u4ef7\u503c\u5728\u4e8e&#xff1a;\u65ad\u70b9\u53d8\u5316\u53ef\u4ee5\u7edf\u4e00\u7ef4\u62a4&#xff0c;\u9875\u9762\u5bbd\u5ea6\u4ecd\u7531\u9875\u9762\u81ea\u5df1\u6d4b\u91cf&#xff0c;\u5b89\u5168\u533a\u4e0d\u9700\u8981\u6bcf\u4e2a\u9875\u9762\u76f4\u63a5\u8bbf\u95ee\u7a97\u53e3\u5bf9\u8c61\u3002\u8fd9\u6837\u5199\u4e0d\u4f1a\u628a Ability \u751f\u547d\u5468\u671f\u3001ArkUI \u9875\u9762\u72b6\u6001\u548c\u4e1a\u52a1\u5361\u7247\u5e03\u5c40\u63c9\u5728\u4e00\u8d77\u3002<\/p>\n<p><img decoding=\"async\" alt=\"\u591a\u8bbe\u5907\u5e03\u5c40\u8fd0\u884c\u6d41\u7a0b\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260731185638-6a6cefe63f6e3.png\" \/><\/p>\n<h3>2. \u5148\u770b\u6e90\u7801\u8fb9\u754c&#xff1a;\u65ad\u70b9\u4e0d\u662f\u9875\u9762\u81ea\u5df1\u731c\u51fa\u6765\u7684<\/h3>\n<p>BreakpointSystem.ets \u662f\u8fd9\u5957\u9002\u914d\u94fe\u8def\u7684\u5165\u53e3\u3002\u5b83\u6ca1\u6709\u628a\u7a97\u53e3\u5bbd\u5ea6\u5224\u65ad\u6563\u843d\u5230\u6bcf\u4e2a\u9875\u9762&#xff0c;\u800c\u662f\u7528 &#064;kit.ArkUI \u7684 mediaquery \u6ce8\u518c\u4e09\u6761\u76d1\u542c\u89c4\u5219&#xff1a;<\/p>\n<p>import { mediaquery } from &#039;&#064;kit.ArkUI&#039;;<\/p>\n<p>export type BreakpointType &#061; &#039;sm&#039; | &#039;md&#039; | &#039;lg&#039;;<\/p>\n<p>export class BreakpointSystem {<br \/>\n  private static currentBp: BreakpointType &#061; &#039;sm&#039;;<br \/>\n  private static smListener: mediaquery.MediaQueryListener | null &#061; null;<br \/>\n  private static mdListener: mediaquery.MediaQueryListener | null &#061; null;<br \/>\n  private static lgListener: mediaquery.MediaQueryListener | null &#061; null;<\/p>\n<p>  static register(): void {<br \/>\n    this.smListener &#061; mediaquery.matchMediaSync(&#039;(width&lt;&#061;600vp)&#039;);<br \/>\n    this.mdListener &#061; mediaquery.matchMediaSync(&#039;(600vp&lt;width&lt;&#061;840vp)&#039;);<br \/>\n    this.lgListener &#061; mediaquery.matchMediaSync(&#039;(840vp&lt;width)&#039;);<\/p>\n<p>    this.smListener.on(&#039;change&#039;, result &#061;&gt; {<br \/>\n      if (result.matches) {<br \/>\n        this.update(&#039;sm&#039;);<br \/>\n      }<br \/>\n    });<br \/>\n    this.mdListener.on(&#039;change&#039;, result &#061;&gt; {<br \/>\n      if (result.matches) {<br \/>\n        this.update(&#039;md&#039;);<br \/>\n      }<br \/>\n    });<br \/>\n    this.lgListener.on(&#039;change&#039;, result &#061;&gt; {<br \/>\n      if (result.matches) {<br \/>\n        this.update(&#039;lg&#039;);<br \/>\n      }<br \/>\n    });<\/p>\n<p>    if (this.smListener.matches) {<br \/>\n      this.update(&#039;sm&#039;);<br \/>\n    } else if (this.mdListener.matches) {<br \/>\n      this.update(&#039;md&#039;);<br \/>\n    } else {<br \/>\n      this.update(&#039;lg&#039;);<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u53ef\u4ee5\u5f97\u51fa\u4e09\u4e2a\u786e\u5b9a\u4e8b\u5b9e\u3002<\/p>\n<p>\u7b2c\u4e00&#xff0c;\u6e90\u7801\u91cc\u7684\u65ad\u70b9\u53ea\u6709 sm\u3001md\u3001lg \u4e09\u79cd\u3002sm \u8986\u76d6 width&lt;&#061;600vp&#xff0c;md \u8986\u76d6 600vp&lt;width&lt;&#061;840vp&#xff0c;lg \u8986\u76d6 840vp&lt;width\u3002\u56e0\u6b64\u6587\u7ae0\u4e0d\u80fd\u989d\u5916\u58f0\u79f0\u6e90\u7801\u5b9e\u73b0\u4e86\u66f4\u591a\u8bbe\u5907\u7b49\u7ea7&#xff0c;\u4f8b\u5982\u72ec\u7acb\u7684 xl\u3001pc \u6216 fold\u3002<\/p>\n<p>\u7b2c\u4e8c&#xff0c;\u65ad\u70b9\u7531\u5a92\u4f53\u67e5\u8be2\u76d1\u542c\u9a71\u52a8\u3002\u9875\u9762\u4e0d\u9700\u8981\u4e3b\u52a8\u8f6e\u8be2\u7a97\u53e3\u5bbd\u5ea6&#xff0c;\u76d1\u542c\u5668\u5728\u5339\u914d\u7ed3\u679c\u6539\u53d8\u540e\u901a\u8fc7 update() \u5199\u5165\u72b6\u6001\u3002<\/p>\n<p>\u7b2c\u4e09&#xff0c;\u6ce8\u518c\u540e\u4f1a\u7acb\u5373\u6267\u884c\u4e00\u6b21\u521d\u59cb\u5224\u65ad\u3002\u8fd9\u4e2a\u521d\u59cb\u5224\u65ad\u5bf9\u542f\u52a8\u6001\u5f88\u5173\u952e&#xff1a;\u5982\u679c\u6ca1\u6709\u5b83&#xff0c;\u9875\u9762\u7b2c\u4e00\u6b21\u6784\u5efa\u65f6\u53ef\u80fd\u4e00\u76f4\u505c\u5728\u9ed8\u8ba4 sm&#xff0c;\u53ea\u6709\u4e0b\u4e00\u6b21\u7a97\u53e3\u53d8\u5316\u540e\u624d\u8fdb\u5165\u6b63\u786e\u5e03\u5c40\u3002<\/p>\n<h3>3. \u7528 AppStorage \u4f20\u64ad currentBreakpoint<\/h3>\n<p>\u65ad\u70b9\u66f4\u65b0\u7684\u771f\u6b63\u51fa\u53e3\u662f update(bp)\u3002\u6e90\u7801\u91cc\u5b83\u540c\u65f6\u7ef4\u62a4\u7c7b\u5185\u90e8\u5b57\u6bb5\u548c AppStorage&#xff1a;<\/p>\n<p>private static update(bp: BreakpointType): void {<br \/>\n  this.currentBp &#061; bp;<br \/>\n  AppStorage.setOrCreate&lt;string&gt;(&#039;currentBreakpoint&#039;, bp);<br \/>\n}<\/p>\n<p>static current(): BreakpointType {<br \/>\n  return this.currentBp;<br \/>\n}<\/p>\n<p>static select&lt;T&gt;(sm: T, md: T, lg: T): T {<br \/>\n  if (this.currentBp &#061;&#061;&#061; &#039;sm&#039;) {<br \/>\n    return sm;<br \/>\n  }<br \/>\n  if (this.currentBp &#061;&#061;&#061; &#039;md&#039;) {<br \/>\n    return md;<br \/>\n  }<br \/>\n  return lg;<br \/>\n}<\/p>\n<p>\u8fd9\u91cc\u7684\u5de5\u7a0b\u53d6\u820d\u6bd4\u8f83\u6e05\u695a\u3002BreakpointSystem.current() \u548c select() \u9002\u5408\u666e\u901a\u5de5\u5177\u4ee3\u7801\u540c\u6b65\u8bfb\u53d6\u5f53\u524d\u65ad\u70b9&#xff1b;\u9875\u9762\u5c42\u66f4\u5e38\u7528\u7684\u662f &#064;StorageLink(&#039;currentBreakpoint&#039;)&#xff0c;\u56e0\u4e3a\u5b83\u53ef\u4ee5\u8ba9 ArkUI \u9875\u9762\u5728\u503c\u53d8\u5316\u540e\u91cd\u65b0\u6e32\u67d3\u3002\u5bf9\u591a\u8bbe\u5907\u5e03\u5c40\u6765\u8bf4&#xff0c;\u540e\u8005\u6bd4\u5728\u9875\u9762\u91cc\u624b\u52a8\u4fdd\u5b58\u4e00\u4e2a\u666e\u901a\u5b57\u6bb5\u66f4\u53ef\u9760\u3002<\/p>\n<p>\u5982\u679c\u9875\u9762\u81ea\u5df1\u8c03\u7528 BreakpointSystem.current()&#xff0c;\u5b83\u53ea\u80fd\u8bfb\u5230\u5f53\u524d\u503c&#xff1b;\u5982\u679c\u503c\u4e4b\u540e\u6539\u53d8&#xff0c;\u9875\u9762\u8fd8\u8981\u81ea\u5df1\u5904\u7406\u5237\u65b0\u3002\u6e90\u7801\u91c7\u7528 AppStorage \u7684\u597d\u5904\u662f\u628a\u65ad\u70b9\u53d8\u6210\u4e86\u4e00\u4e2a\u8de8\u9875\u9762\u54cd\u5e94\u5f0f\u4fe1\u53f7\u3002<\/p>\n<h3>4. EntryAbility \u8d1f\u8d23\u6ce8\u518c\u548c\u6e05\u7406&#xff0c;\u4e0d\u628a\u76d1\u542c\u5668\u7559\u7ed9\u9875\u9762<\/h3>\n<p>\u65ad\u70b9\u76d1\u542c\u5668\u7684\u751f\u547d\u5468\u671f\u4e0d\u80fd\u968f\u4fbf\u653e\u3002\u653e\u5728\u67d0\u4e2a\u9875\u9762\u91cc&#xff0c;\u7528\u6237\u5207\u6362\u9875\u9762\u4ee5\u540e\u53ef\u80fd\u51fa\u73b0\u91cd\u590d\u6ce8\u518c\u3001\u6f0f\u6e05\u7406\u3001\u9875\u9762\u9500\u6bc1\u540e\u4ecd\u7136\u56de\u8c03\u7684\u95ee\u9898\u3002\u7b14\u4e0b\u751f\u8f89\u628a\u6ce8\u518c\u653e\u5728 EntryAbility.onCreate()&#xff0c;\u628a\u6e05\u7406\u653e\u5728 onDestroy()&#xff1a;<\/p>\n<p>import { BreakpointSystem } from &#039;libraryb\/src\/main\/ets\/utils\/BreakpointSystem&#039;;<\/p>\n<p>export default class EntryAbility extends UIAbility {<br \/>\n  onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {<br \/>\n    UserDataManager.init(this.context);<br \/>\n    AppStorage.setOrCreate&lt;number&gt;(&#039;currentTabIndex&#039;, 0);<br \/>\n    AppStorage.setOrCreate&lt;number&gt;(&#039;favoriteTabIndex&#039;, 0);<br \/>\n    AppStorage.setOrCreate&lt;number&gt;(&#039;topAvoidAreaHeightPx&#039;, 0);<br \/>\n    AppStorage.setOrCreate&lt;number&gt;(&#039;navigationIndicatorHeightPx&#039;, 0);<br \/>\n    BreakpointSystem.register();<br \/>\n  }<\/p>\n<p>  onDestroy(): void {<br \/>\n    BreakpointSystem.unregister();<br \/>\n  }<br \/>\n}<\/p>\n<p>\u8fd9\u4e2a\u4f4d\u7f6e\u662f\u5408\u7406\u7684&#xff1a;\u5e94\u7528\u5165\u53e3\u521b\u5efa\u65f6\u6ce8\u518c\u8bbe\u5907\u7ea7\u76d1\u542c&#xff0c;Ability \u9500\u6bc1\u65f6\u91ca\u653e\u3002\u8fd9\u6837\u9875\u9762\u53ea\u6d88\u8d39\u72b6\u6001&#xff0c;\u4e0d\u62e5\u6709\u76d1\u542c\u5668\u3002\u5bf9\u4e00\u5957\u6587\u7ae0\u5e94\u7528\u6765\u8bf4&#xff0c;\u9875\u9762\u6570\u91cf\u8d8a\u591a&#xff0c;\u8fd9\u4e2a\u8fb9\u754c\u8d8a\u91cd\u8981&#xff0c;\u56e0\u4e3a\u9996\u9875\u3001\u9898\u5e93\u9875\u3001\u8be6\u60c5\u9875\u3001\u5206\u7c7b\u9875\u90fd\u53ef\u80fd\u9700\u8981\u540c\u4e00\u4e2a\u65ad\u70b9\u3002<\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u6e90\u7801\u91cc\u7684 unregister() \u4f1a\u5bf9\u975e\u7a7a\u76d1\u542c\u5668\u8c03\u7528 off(&#039;change&#039;)\u3002\u8fd9\u80fd\u907f\u514d\u76d1\u542c\u5668\u5728 Ability \u751f\u547d\u5468\u671f\u7ed3\u675f\u540e\u7ee7\u7eed\u5de5\u4f5c\u3002\u5b9e\u9645\u9879\u76ee\u8fd8\u53ef\u4ee5\u8fdb\u4e00\u6b65\u628a listener \u7f6e\u7a7a&#xff0c;\u4f46\u5f53\u524d\u6e90\u7801\u5df2\u7ecf\u8868\u8fbe\u51fa\u6e05\u7406\u610f\u56fe\u3002<\/p>\n<p><img decoding=\"async\" alt=\"\u591a\u8bbe\u5907\u5e03\u5c40\u804c\u8d23\u7ed3\u6784\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260731185638-6a6cefe6c3ba0.png\" \/><\/p>\n<h3>5. \u5b89\u5168\u533a\u662f\u7b2c\u4e8c\u6761\u9002\u914d\u4e3b\u7ebf<\/h3>\n<p>\u591a\u8bbe\u5907\u9002\u914d\u4e0d\u53ea\u662f\u5bbd\u5ea6\u3002HarmonyOS \u8bbe\u5907\u4e0a\u72b6\u6001\u680f\u3001\u5bfc\u822a\u6761\u3001\u624b\u52bf\u6307\u793a\u6761\u3001\u6c89\u6d78\u5f0f\u7a97\u53e3\u90fd\u4f1a\u6539\u53d8\u53ef\u7528\u533a\u57df\u3002\u7b14\u4e0b\u751f\u8f89\u5728 EntryAbility.onWindowStageCreate() \u4e2d\u62ff\u5230 mainWindow&#xff0c;\u5e76\u5c1d\u8bd5\u5f00\u542f\u5168\u5c4f\u5e03\u5c40&#xff0c;\u540c\u65f6\u8bfb\u53d6\u907f\u8ba9\u533a&#xff1a;<\/p>\n<p>const mainWindow &#061; windowStage.getMainWindowSync();<br \/>\nmainWindow.setWindowLayoutFullScreen(true);<br \/>\nmainWindow.setWindowSystemBarProperties({<br \/>\n  statusBarContentColor: &#039;#000000&#039;,<br \/>\n  navigationBarContentColor: &#039;#000000&#039;<br \/>\n});<\/p>\n<p>this.updateTopAvoidAreaHeight(mainWindow);<br \/>\nthis.updateNavigationIndicatorHeight(mainWindow);<br \/>\nmainWindow.on(&#039;avoidAreaChange&#039;, data &#061;&gt; {<br \/>\n  this.updateTopAvoidAreaHeight(mainWindow);<br \/>\n  this.updateNavigationIndicatorHeight(mainWindow);<br \/>\n});<\/p>\n<p>\u6e90\u7801\u540e\u7eed\u628a\u9876\u90e8\u907f\u8ba9\u533a\u5199\u8fdb topAvoidAreaHeightPx&#xff0c;\u628a\u5e95\u90e8\u5bfc\u822a\u6307\u793a\u533a\u57df\u548c\u7cfb\u7edf\u533a\u57df\u53d6\u8f83\u5927\u503c\u540e\u5199\u8fdb navigationIndicatorHeightPx\u3002\u9875\u9762\u4fa7\u4e0d\u76f4\u63a5\u8bbf\u95ee Window&#xff0c;\u53ea\u901a\u8fc7 &#064;StorageLink \u6d88\u8d39\u8fd9\u4e24\u4e2a\u6570\u503c\u3002<\/p>\n<p>\u8fd9\u4e2a\u8bbe\u8ba1\u907f\u514d\u4e86\u4e00\u4e2a\u5e38\u89c1\u95ee\u9898&#xff1a;\u9875\u9762\u4e3a\u4e86\u8ba1\u7b97\u5e95\u90e8 padding \u5230\u5904\u8bfb\u53d6\u7a97\u53e3\u5b89\u5168\u533a&#xff0c;\u6700\u540e\u6bcf\u4e2a\u9875\u9762\u5904\u7406\u5355\u4f4d\u8f6c\u6362\u548c\u9ed8\u8ba4\u503c\u7684\u903b\u8f91\u90fd\u4e0d\u4e00\u81f4\u3002\u73b0\u5728\u5165\u53e3\u5c42\u7edf\u4e00\u5199\u5165 px&#xff0c;\u9875\u9762\u5c42\u6309\u9700\u8981\u8f6c\u6362\u4e3a vp&#xff0c;\u518d\u548c\u6700\u5c0f padding \u505a Math.max()\u3002<\/p>\n<h3>6. Index&#xff1a;\u5e95\u90e8\u5bfc\u822a\u5df2\u7ecf\u505a\u5b89\u5168\u533a\u907f\u8ba9&#xff0c;\u4f46\u4fa7\u8fb9\u5bfc\u822a\u5206\u652f\u76ee\u524d\u4e0d\u53ef\u8fbe<\/h3>\n<p>Index.ets \u91cc\u6709\u4e09\u7c7b\u5171\u4eab\u72b6\u6001&#xff1a;<\/p>\n<p>&#064;StorageLink(&#039;currentBreakpoint&#039;) currentBp: string &#061; &#039;sm&#039;;<br \/>\n&#064;StorageLink(&#039;topAvoidAreaHeightPx&#039;) topAvoidAreaHeightPx: number &#061; 0;<br \/>\n&#064;StorageLink(&#039;navigationIndicatorHeightPx&#039;) navigationIndicatorHeightPx: number &#061; 0;<br \/>\n&#064;StorageLink(&#039;currentTabIndex&#039;) currentIndex: number &#061; 0;<\/p>\n<p>\u5b83\u8fd8\u5b9a\u4e49\u4e86\u9876\u90e8\u548c\u5e95\u90e8\u5b89\u5168\u533a\u8f6c\u6362&#xff1a;<\/p>\n<p>private bottomSafePadding(): number {<br \/>\n  return Math.max(Sizes.BOTTOM_NAV_MIN_PADDING, px2vp(this.navigationIndicatorHeightPx));<br \/>\n}<\/p>\n<p>private topSafePadding(): number {<br \/>\n  return Math.max(Sizes.PADDING_SMALL, px2vp(this.topAvoidAreaHeightPx));<br \/>\n}<\/p>\n<p>private bottomNavHeight(): number {<br \/>\n  return Sizes.TAB_BAR_HEIGHT &#043; this.bottomSafePadding();<br \/>\n}<\/p>\n<p>\u8fd9\u8bf4\u660e\u4e3b\u9875\u9762\u5e95\u90e8\u5bfc\u822a\u4e0d\u662f\u56fa\u5b9a\u8d34\u5e95&#xff0c;\u800c\u662f\u628a\u7cfb\u7edf\u5e95\u90e8\u533a\u57df\u7eb3\u5165\u9ad8\u5ea6\u8ba1\u7b97\u3002\u5bf9\u624b\u52bf\u5bfc\u822a\u8bbe\u5907\u3001\u5c0f\u7a97\u6a21\u5f0f\u548c\u4e0d\u540c\u8bbe\u5907\u5e95\u90e8\u5b89\u5168\u533a\u6765\u8bf4&#xff0c;\u8fd9\u6bd4\u5199\u6b7b 56vp \u66f4\u7a33\u3002<\/p>\n<p>\u4f46 Index.ets \u91cc\u6709\u4e00\u4e2a\u5fc5\u987b\u5982\u5b9e\u8bf4\u660e\u7684\u6e90\u7801\u8fb9\u754c\u3002\u6784\u5efa\u903b\u8f91\u4e2d&#xff0c;\u5f53\u524d\u5224\u65ad\u628a sm\u3001md\u3001lg \u90fd\u5f52\u5165\u5e95\u90e8\u5bfc\u822a\u5206\u652f&#xff1a;<\/p>\n<p>if (this.currentBp &#061;&#061;&#061; &#039;sm&#039; || this.currentBp &#061;&#061;&#061; &#039;md&#039; || this.currentBp &#061;&#061;&#061; &#039;lg&#039;) {<br \/>\n  Column() {<br \/>\n    Stack() {<br \/>\n      this.buildCurrentPage()<br \/>\n    }<br \/>\n    .layoutWeight(1)<\/p>\n<p>    this.buildBottomNav()<br \/>\n  }<br \/>\n} else {<br \/>\n  Row() {<br \/>\n    this.buildSideNav()<br \/>\n    this.buildCurrentPage()<br \/>\n  }<br \/>\n}<\/p>\n<p>\u7531\u4e8e BreakpointSystem \u53ea\u4f1a\u5199\u5165 sm\u3001md\u3001lg&#xff0c;else \u5206\u652f\u5f53\u524d\u4e0d\u4f1a\u8fdb\u5165\u3002\u8fd9\u4e0d\u662f\u6587\u7ae0\u63a8\u65ad&#xff0c;\u800c\u662f\u7531\u4e24\u4e2a\u6587\u4ef6\u5171\u540c\u51b3\u5b9a\u7684\u4e8b\u5b9e\u3002\u56e0\u6b64\u7b14\u4e0b\u751f\u8f89\u5f53\u524d\u4e3b\u5bfc\u822a\u7684\u771f\u5b9e\u72b6\u6001\u662f&#xff1a;\u5e95\u90e8\u5bfc\u822a\u652f\u6301\u6240\u6709\u65ad\u70b9\u5e76\u5904\u7406\u5b89\u5168\u533a&#xff1b;\u4fa7\u8fb9\u5bfc\u822a\u4ee3\u7801\u5b58\u5728&#xff0c;\u4f46\u6ca1\u6709\u88ab\u5f53\u524d\u65ad\u70b9\u6761\u4ef6\u89e6\u53d1\u3002\u540e\u7eed\u5982\u679c\u8981\u8ba9 PC\/2in1 \u4f7f\u7528\u4fa7\u8fb9\u5bfc\u822a&#xff0c;\u53ef\u4ee5\u628a\u6761\u4ef6\u6536\u7a84\u4e3a sm\u3001md \u4f7f\u7528\u5e95\u90e8\u5bfc\u822a&#xff0c;lg \u4f7f\u7528\u4fa7\u8fb9\u5bfc\u822a&#xff0c;\u6216\u8005\u589e\u52a0\u66f4\u660e\u786e\u7684\u7a97\u53e3\u5f62\u6001\u5224\u65ad\u3002<\/p>\n<h3>7. \u5217\u8868\u9875&#xff1a;\u65ad\u70b9\u52a0 pageWidth \u624d\u51b3\u5b9a\u662f\u5426\u7f51\u683c\u5316<\/h3>\n<p>BankListPage.ets \u6ca1\u6709\u53ea\u4f9d\u8d56 currentBreakpoint\u3002\u5b83\u8fd8\u7ef4\u62a4\u9875\u9762\u5b9e\u9645\u5bbd\u5ea6&#xff1a;<\/p>\n<p>&#064;StorageLink(&#039;currentBreakpoint&#039;) currentBp: string &#061; &#039;sm&#039;;<br \/>\n&#064;State private pageWidth: number &#061; 360;<\/p>\n<p>private useGridLayout(): boolean {<br \/>\n  return this.currentBp &#061;&#061;&#061; &#039;lg&#039; &amp;&amp; this.pageWidth &gt;&#061; 700;<br \/>\n}<\/p>\n<p>\u9875\u9762\u901a\u8fc7 onAreaChange \u66f4\u65b0 pageWidth\u3002\u8fd9\u4e00\u6b65\u975e\u5e38\u5b9e\u9645&#xff0c;\u56e0\u4e3a\u5728\u5e73\u677f\u3001\u6298\u53e0\u5c4f\u3001PC\/2in1 \u7a97\u53e3\u4e2d&#xff0c;\u8bbe\u5907\u7ea7\u65ad\u70b9\u548c\u5f53\u524d\u5bb9\u5668\u5bbd\u5ea6\u5e76\u4e0d\u603b\u662f\u7b49\u4ef7\u3002\u4e00\u4e2a lg \u65ad\u70b9\u4e0b\u7684\u5206\u5c4f\u7a97\u53e3\u53ef\u80fd\u5e76\u6ca1\u6709\u8db3\u591f\u7a7a\u95f4\u5c55\u793a\u4e09\u5217\u5361\u7247&#xff1b;\u53cd\u8fc7\u6765&#xff0c;\u67d0\u4e9b\u4e2d\u7b49\u7a97\u53e3\u5982\u679c\u5185\u5bb9\u533a\u88ab\u4fa7\u680f\u3001\u5f39\u7a97\u6216\u7cfb\u7edf\u533a\u57df\u6324\u538b&#xff0c;\u4e5f\u9700\u8981\u56de\u9000\u5230\u5217\u8868\u3002<\/p>\n<p>\u6e90\u7801\u91cc\u5f53 useGridLayout() \u4e3a\u771f\u65f6\u4f7f\u7528 Scroll &#043; Flex \u5305\u88f9\u5361\u7247&#xff0c;\u5e76\u628a\u5355\u9879\u5bbd\u5ea6\u8bbe\u4e3a\u7ea6 32%&#xff1b;\u5426\u5219\u4f7f\u7528 List \u548c BankCard\u3002\u8fd9\u5c31\u662f\u7b14\u4e0b\u751f\u8f89\u5217\u8868\u9002\u914d\u7684\u6838\u5fc3&#xff1a;\u4e0d\u662f\u201c\u5bbd\u5c4f\u5fc5\u5b9a\u7f51\u683c\u201d&#xff0c;\u800c\u662f\u201c\u65ad\u70b9\u4e3a\u5927\u5c4f\u4e14\u5b9e\u9645\u9875\u9762\u5bbd\u5ea6\u8fbe\u5230\u9608\u503c\u624d\u7f51\u683c\u201d\u3002<\/p>\n<p>\u8fc1\u79fb\u5230\u5176\u4ed6 HarmonyOS \u9875\u9762\u65f6&#xff0c;\u53ef\u4ee5\u4fdd\u7559\u8fd9\u4e2a\u5224\u65ad\u6a21\u5f0f&#xff1a;<\/p>\n<p>&#064;StorageLink(&#039;currentBreakpoint&#039;) currentBp: string &#061; &#039;sm&#039;;<br \/>\n&#064;State private pageWidth: number &#061; 360;<\/p>\n<p>private canUseThreeColumn(): boolean {<br \/>\n  return this.currentBp &#061;&#061;&#061; &#039;lg&#039; &amp;&amp; this.pageWidth &gt;&#061; 700;<br \/>\n}<\/p>\n<p>build() {<br \/>\n  Column() {<br \/>\n    if (this.canUseThreeColumn()) {<br \/>\n      this.buildGridContent();<br \/>\n    } else {<br \/>\n      this.buildListContent();<br \/>\n    }<br \/>\n  }<br \/>\n  .onAreaChange((oldArea, newArea) &#061;&gt; {<br \/>\n    const width &#061; Number(newArea.width);<br \/>\n    if (width &gt; 0) {<br \/>\n      this.pageWidth &#061; width;<br \/>\n    }<br \/>\n  })<br \/>\n}<\/p>\n<p>\u8fd9\u6bb5\u6a21\u5f0f\u7684\u8fb9\u754c\u4e5f\u5f88\u6e05\u6670&#xff1a;currentBreakpoint \u5224\u65ad\u5168\u5c40\u7a97\u53e3\u7ea7\u522b&#xff0c;pageWidth \u5224\u65ad\u5f53\u524d\u7ec4\u4ef6\u53ef\u7528\u7a7a\u95f4\u3002\u4e24\u4e2a\u6761\u4ef6\u540c\u65f6\u6ee1\u8db3&#xff0c;\u624d\u8fdb\u5165\u66f4\u6fc0\u8fdb\u7684\u5e03\u5c40\u3002<\/p>\n<h3>8. \u9996\u9875\u3001\u9898\u5e93\u3001\u7edf\u8ba1\u9875\u590d\u7528\u540c\u4e00\u7c7b\u5224\u65ad<\/h3>\n<p>\u4ece\u6e90\u7801\u770b&#xff0c;HomePage.ets\u3001ExamTab.ets\u3001LearningStatsPage.ets \u90fd\u91c7\u7528\u7c7b\u4f3c\u7b56\u7565&#xff1a;\u7528 &#064;StorageLink(&#039;currentBreakpoint&#039;) \u83b7\u53d6\u65ad\u70b9&#xff0c;\u7528 &#064;State pageWidth \u4fdd\u5b58\u9875\u9762\u5bbd\u5ea6&#xff0c;\u518d\u7528 currentBp &#061;&#061;&#061; &#039;lg&#039; &amp;&amp; pageWidth &gt;&#061; 700 \u4f5c\u4e3a\u7f51\u683c\u6216\u5bbd\u5c4f\u5e03\u5c40\u7684\u5f00\u5173\u3002<\/p>\n<p>\u8fd9\u79cd\u91cd\u590d\u4e0d\u662f\u574f\u4e8b\u3002\u5b83\u8bf4\u660e\u9879\u76ee\u628a\u5e03\u5c40\u7b56\u7565\u4fdd\u6301\u5728\u9875\u9762\u5c40\u90e8&#xff0c;\u800c\u4e0d\u662f\u8fc7\u65e9\u62bd\u8c61\u6210\u4e00\u4e2a\u5168\u5c40\u4e07\u80fd\u5e03\u5c40\u670d\u52a1\u3002\u9996\u9875\u3001\u9898\u5e93\u548c\u7edf\u8ba1\u9875\u7684\u5361\u7247\u5185\u5bb9\u4e0d\u540c&#xff0c;\u9608\u503c\u73b0\u5728\u6070\u597d\u4e00\u81f4&#xff0c;\u4f46\u5b83\u4eec\u5404\u81ea\u4ecd\u6709\u72ec\u7acb\u8c03\u6574\u7a7a\u95f4\u3002\u7b49\u5230\u591a\u4e2a\u9875\u9762\u7684\u5e03\u5c40\u8ba1\u7b97\u5b8c\u5168\u7a33\u5b9a\u4ee5\u540e&#xff0c;\u518d\u8003\u8651\u628a\u9608\u503c\u5e38\u91cf\u62bd\u5230\u5171\u4eab\u5c42\u4f1a\u66f4\u7a33\u3002<\/p>\n<p>\u53ef\u4ee5\u628a\u8fd9\u7c7b\u9875\u9762\u7684\u5224\u65ad\u6574\u7406\u6210\u4e00\u4e2a\u51b3\u7b56\u8868&#xff1a;<\/p>\n<table>\n<tr>currentBreakpointpageWidth\u9875\u9762\u7b56\u7565<\/tr>\n<tbody>\n<tr>\n<td>sm<\/td>\n<td>\u4efb\u610f<\/td>\n<td>\u4f18\u5148\u5355\u5217\u3001\u5e95\u90e8\u5bfc\u822a\u3001\u7eb5\u5411\u6eda\u52a8<\/td>\n<\/tr>\n<tr>\n<td>md<\/td>\n<td>\u4efb\u610f<\/td>\n<td>\u4ecd\u4fdd\u6301\u8f83\u4fdd\u5b88\u7684\u5361\u7247\u6d41&#xff0c;\u907f\u514d\u5206\u680f\u8fc7\u65e9\u51fa\u73b0<\/td>\n<\/tr>\n<tr>\n<td>lg<\/td>\n<td>&lt;700<\/td>\n<td>\u56de\u9000\u5217\u8868\u6216\u5355\u5217&#xff0c;\u9002\u914d\u5c0f\u7a97\u548c\u5206\u5c4f<\/td>\n<\/tr>\n<tr>\n<td>lg<\/td>\n<td>&gt;&#061;700<\/td>\n<td>\u5141\u8bb8\u7f51\u683c\u3001\u5bbd\u5c4f\u5361\u7247\u6216\u5de6\u53f3\u5206\u533a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u4e2a\u8868\u4e5f\u89e3\u91ca\u4e86\u4e3a\u4ec0\u4e48\u6e90\u7801\u6ca1\u6709\u7b80\u5355\u5730\u628a md \u5f53\u6210\u5e73\u677f\u5e03\u5c40\u3002\u5e73\u677f\u3001\u6298\u53e0\u5c4f\u548c PC \u5c0f\u7a97\u90fd\u53ef\u80fd\u51fa\u73b0\u4e2d\u95f4\u72b6\u6001&#xff0c;pageWidth \u80fd\u907f\u514d\u5e03\u5c40\u88ab\u65ad\u70b9\u8bef\u5224\u3002<\/p>\n<h3>9. BankDetailPage&#xff1a;\u5bbd\u5c4f\u8be6\u60c5\u9875\u4e0d\u662f\u6362\u4e00\u5c42\u5bb9\u5668\u8fd9\u4e48\u7b80\u5355<\/h3>\n<p>\u8be6\u60c5\u9875\u7684\u591a\u8bbe\u5907\u9002\u914d\u66f4\u5bb9\u6613\u51fa\u89c6\u89c9\u95ee\u9898\u3002\u5217\u8868\u9875\u6700\u591a\u662f\u5355\u5217\u548c\u591a\u5217&#xff0c;\u8be6\u60c5\u9875\u8fd8\u8981\u5904\u7406\u6807\u9898\u3001\u6536\u85cf\u3001\u5185\u5bb9\u3001\u76f8\u5173\u4fe1\u606f\u548c\u5e95\u90e8\u533a\u57df\u3002BankDetailPage.ets \u7684\u5224\u65ad\u662f&#xff1a;<\/p>\n<p>&#064;StorageLink(&#039;currentBreakpoint&#039;) currentBp: string &#061; &#039;sm&#039;;<br \/>\n&#064;StorageLink(&#039;navigationIndicatorHeightPx&#039;) navigationIndicatorHeightPx: number &#061; 0;<br \/>\n&#064;State private pageWidth: number &#061; 360;<\/p>\n<p>private useWideLayout(): boolean {<br \/>\n  return this.currentBp &#061;&#061;&#061; &#039;lg&#039; &amp;&amp; this.pageWidth &gt;&#061; 700;<br \/>\n}<\/p>\n<p>private bottomSafePadding(): number {<br \/>\n  return Math.max(Sizes.BOTTOM_NAV_MIN_PADDING, px2vp(this.navigationIndicatorHeightPx));<br \/>\n}<\/p>\n<p>\u6e90\u7801\u91cc\u5bbd\u5c4f\u5e03\u5c40\u4f1a\u8c03\u6574\u5361\u7247\u9ad8\u5ea6&#xff0c;\u4f8b\u5982\u5bbd\u5c4f\u65f6\u4f7f\u7528\u66f4\u9ad8\u7684\u5c55\u793a\u533a\u57df&#xff0c;\u7a84\u5c4f\u65f6\u4fdd\u6301\u66f4\u7d27\u51d1\u3002HakkaBankPage.ets \u53ea\u662f\u628a\u56fa\u5b9a\u8c1a\u8bed ID \u4f20\u7ed9 BankDetailContent({ fixedBankId: &#039;b_hakka&#039; })&#xff0c;\u56e0\u6b64\u5ba2\u5bb6\u4e13\u9898\u8be6\u60c5\u4e0d\u9700\u8981\u590d\u5236\u4e00\u4efd\u9002\u914d\u903b\u8f91\u3002\u8fd9\u4e2a\u590d\u7528\u70b9\u503c\u5f97\u4fdd\u7559&#xff1a;\u4e13\u9898\u5165\u53e3\u53ef\u4ee5\u4e0d\u540c&#xff0c;\u5185\u5bb9\u9875\u9002\u914d\u4ecd\u7531\u540c\u4e00\u4e2a\u7ec4\u4ef6\u8d1f\u8d23\u3002<\/p>\n<p>\u8be6\u60c5\u9875\u7684\u5173\u952e\u4e0d\u662f\u201c\u5c4f\u5e55\u5927\u5c31\u585e\u66f4\u591a\u4e1c\u897f\u201d&#xff0c;\u800c\u662f\u5148\u786e\u8ba4\u5bb9\u5668\u5bbd\u5ea6\u8db3\u591f&#xff0c;\u518d\u6539\u53d8\u9605\u8bfb\u8282\u594f\u3002\u5bf9\u8c1a\u8bed\u7c7b\u5e94\u7528\u6765\u8bf4&#xff0c;\u592a\u65e9\u8fdb\u5165\u53cc\u680f\u4f1a\u8ba9\u6587\u5b57\u9605\u8bfb\u8def\u5f84\u53d8\u6563&#xff1b;\u592a\u665a\u8fdb\u5165\u5bbd\u5c4f\u53c8\u6d6a\u8d39\u7a7a\u95f4\u3002lg &amp;&amp; pageWidth &gt;&#061; 700 \u662f\u4e00\u4e2a\u4fdd\u5b88\u9608\u503c&#xff0c;\u80fd\u8986\u76d6\u5927\u591a\u6570\u5e73\u677f\u6a2a\u5c4f\u548c PC\/2in1 \u7a97\u53e3&#xff0c;\u540c\u65f6\u4e0d\u7ed9\u624b\u673a\u6a2a\u5c4f\u5f3a\u884c\u5957\u5927\u5c4f\u5e03\u5c40\u3002<\/p>\n<h3>10. CategoryPage&#xff1a;\u6309\u5bb9\u5668\u5bbd\u5ea6\u63a7\u5236\u5361\u7247\u6bd4\u4f8b<\/h3>\n<p>CategoryPage.ets \u6ca1\u6709\u63a5\u5165 currentBreakpoint&#xff0c;\u5b83\u76f4\u63a5\u7528\u9875\u9762\u5bbd\u5ea6\u51b3\u5b9a\u5361\u7247\u5360\u6bd4&#xff1a;<\/p>\n<p>&#064;State private pageWidth: number &#061; 360;<\/p>\n<p>private itemWidth(): string {<br \/>\n  return this.pageWidth &gt;&#061; 720 ? &#039;24%&#039; : &#039;48%&#039;;<br \/>\n}<\/p>\n<p>\u8fd9\u4e2a\u5b9e\u73b0\u9002\u5408\u5206\u7c7b\u5361\u7247&#xff0c;\u56e0\u4e3a\u5206\u7c7b\u9875\u66f4\u5173\u5fc3\u201c\u5f53\u524d\u884c\u80fd\u653e\u51e0\u5f20\u5361\u7247\u201d&#xff0c;\u4e0d\u4e00\u5b9a\u9700\u8981\u77e5\u9053\u5168\u5c40\u65ad\u70b9\u300248% \u57fa\u672c\u5bf9\u5e94\u4e24\u5217&#xff0c;24% \u57fa\u672c\u5bf9\u5e94\u56db\u5217&#xff0c;\u4e2d\u95f4\u7559\u7ed9 Flex \u95f4\u8ddd\u548c\u6362\u884c\u3002\u9875\u9762\u901a\u8fc7 onAreaChange \u7ef4\u62a4\u5bbd\u5ea6&#xff0c;Flex \u518d\u8d1f\u8d23\u81ea\u52a8\u6362\u884c\u3002<\/p>\n<p>\u5982\u679c\u628a\u5206\u7c7b\u9875\u4e5f\u5f3a\u884c\u63a5\u5165\u65ad\u70b9&#xff0c;\u53cd\u800c\u53ef\u80fd\u589e\u52a0\u9519\u8bef&#xff1a;\u4e00\u4e2a lg \u8bbe\u5907\u4e0a\u7684\u7a84\u7a97\u53e3\u4e5f\u8bb8\u53ea\u80fd\u653e\u4e24\u5217&#xff1b;\u4e00\u4e2a md \u5bbd\u5ea6\u7684\u5e73\u677f\u7ad6\u5c4f\u4e5f\u53ef\u80fd\u6bd4\u666e\u901a\u624b\u673a\u66f4\u9002\u5408\u66f4\u5bbd\u677e\u7684\u4e24\u5217\u5361\u7247\u3002\u6e90\u7801\u5f53\u524d\u505a\u6cd5\u7b80\u5355&#xff0c;\u4f46\u5951\u5408\u5206\u7c7b\u9875\u7684\u5b9e\u9645\u5e03\u5c40\u76ee\u6807\u3002<\/p>\n<h3>11. ExamResultPage&#xff1a;\u7ed3\u679c\u9875\u91cd\u70b9\u5728\u5e95\u90e8\u53ef\u8fbe\u6027<\/h3>\n<p>\u8003\u8bd5\u7ed3\u679c\u9875\u4e0d\u9700\u8981\u590d\u6742\u5206\u680f&#xff0c;\u4f46\u5b83\u9700\u8981\u4fdd\u8bc1\u5e95\u90e8\u64cd\u4f5c\u4e0d\u88ab\u7cfb\u7edf\u5bfc\u822a\u533a\u906e\u6321\u3002ExamResultPage.ets \u4f7f\u7528 &#064;StorageLink(&#039;navigationIndicatorHeightPx&#039;) \u8bfb\u53d6\u5e95\u90e8\u907f\u8ba9\u503c&#xff0c;\u518d\u901a\u8fc7 bottomSafePadding() \u548c\u9875\u9762\u5e95\u90e8\u95f4\u8ddd\u914d\u5408&#xff0c;\u4fdd\u8bc1\u7ed3\u679c\u9875\u6309\u94ae\u3001\u8bb0\u5f55\u63d0\u793a\u6216\u8fd4\u56de\u64cd\u4f5c\u80fd\u88ab\u89e6\u8fbe\u3002<\/p>\n<p>\u8fd9\u7c7b\u9875\u9762\u7684\u9002\u914d\u6807\u51c6\u548c\u5217\u8868\u9875\u4e0d\u540c\u3002\u5217\u8868\u9875\u5173\u5fc3\u4fe1\u606f\u5bc6\u5ea6&#xff0c;\u7ed3\u679c\u9875\u5173\u5fc3\u64cd\u4f5c\u5b89\u5168\u3002\u5c24\u5176\u5728\u8003\u8bd5\u5b8c\u6210\u540e&#xff0c;\u7528\u6237\u901a\u5e38\u4f1a\u70b9\u51fb\u7ee7\u7eed\u7ec3\u4e60\u3001\u67e5\u770b\u9519\u9898\u3001\u8fd4\u56de\u9996\u9875\u7b49\u52a8\u4f5c&#xff0c;\u5982\u679c\u5e95\u90e8\u6309\u94ae\u8fdb\u5165\u7cfb\u7edf\u624b\u52bf\u533a\u57df&#xff0c;\u771f\u5b9e\u8bbe\u5907\u4e0a\u4f1a\u51fa\u73b0\u8bef\u89e6\u6216\u4e0d\u53ef\u8fbe\u3002<\/p>\n<p>\u56e0\u6b64&#xff0c;\u5224\u65ad\u4e00\u4e2a\u9875\u9762\u662f\u5426\u505a\u597d\u591a\u8bbe\u5907\u9002\u914d&#xff0c;\u4e0d\u80fd\u53ea\u770b\u5b83\u6709\u6ca1\u6709 currentBreakpoint\u3002\u50cf ExamResultPage \u8fd9\u79cd\u7ed3\u679c\u9875&#xff0c;\u5b89\u5168\u533a\u5904\u7406\u6bd4\u7f51\u683c\u5316\u66f4\u91cd\u8981\u3002<\/p>\n<h3>12. \u9a8c\u8bc1\u65b9\u5f0f&#xff1a;\u4e0d\u8981\u53ea\u5728\u4e00\u4e2a\u9884\u89c8\u7a97\u53e3\u91cc\u770b\u6548\u679c<\/h3>\n<p>\u8fd9\u5957\u6e90\u7801\u9002\u914d\u94fe\u8def\u81f3\u5c11\u8981\u6309\u4e09\u7c7b\u4fe1\u53f7\u9a8c\u8bc1\u3002<\/p>\n<table>\n<tr>\u9a8c\u8bc1\u9879\u89c2\u5bdf\u70b9\u9884\u671f<\/tr>\n<tbody>\n<tr>\n<td>\u65ad\u70b9\u53d8\u5316<\/td>\n<td>\u8c03\u6574\u7a97\u53e3\u5bbd\u5ea6\u8de8\u8fc7 600vp \u548c 840vp<\/td>\n<td>currentBreakpoint \u4ece sm \u5230 md\u3001lg \u6539\u53d8<\/td>\n<\/tr>\n<tr>\n<td>\u9875\u9762\u5bbd\u5ea6<\/td>\n<td>\u5206\u5c4f\u3001\u5c0f\u7a97\u3001\u6a2a\u7ad6\u5c4f\u5207\u6362<\/td>\n<td>pageWidth \u968f onAreaChange \u66f4\u65b0<\/td>\n<\/tr>\n<tr>\n<td>\u5217\u8868\/\u7f51\u683c\u5207\u6362<\/td>\n<td>\u8c1a\u8bed\u5217\u8868\u3001\u9996\u9875\u3001\u7edf\u8ba1\u9875<\/td>\n<td>lg &amp;&amp; pageWidth&gt;&#061;700 \u65f6\u51fa\u73b0\u5bbd\u5c4f\u5e03\u5c40&#xff0c;\u5426\u5219\u56de\u9000<\/td>\n<\/tr>\n<tr>\n<td>\u5b89\u5168\u533a<\/td>\n<td>\u624b\u52bf\u5bfc\u822a\u3001\u6c89\u6d78\u5f0f\u7a97\u53e3\u3001\u5e95\u90e8\u5bfc\u822a<\/td>\n<td>\u5e95\u90e8\u6309\u94ae\u548c\u5bfc\u822a\u4e0d\u8d34\u8fdb\u7cfb\u7edf\u624b\u52bf\u533a<\/td>\n<\/tr>\n<tr>\n<td>\u4e3b\u5bfc\u822a\u8fb9\u754c<\/td>\n<td>\u5927\u7a97\u53e3\u4e0b\u6253\u5f00 Index<\/td>\n<td>\u5f53\u524d\u4ecd\u8d70\u5e95\u90e8\u5bfc\u822a&#xff0c;\u4e0d\u5e94\u8bef\u5224\u4e3a\u4fa7\u8fb9\u5bfc\u822a\u5df2\u751f\u6548<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5efa\u8bae\u7684\u672c\u5730\u68c0\u67e5\u8def\u5f84\u662f&#xff1a;\u5148\u5728\u624b\u673a\u5bbd\u5ea6\u770b\u5e95\u90e8\u5bfc\u822a\u548c\u5355\u5217\u5217\u8868&#xff0c;\u518d\u628a\u7a97\u53e3\u62c9\u5230 840vp \u4ee5\u4e0a\u9a8c\u8bc1\u5217\u8868\u548c\u8be6\u60c5\u9875\u7684\u5bbd\u5c4f\u7b56\u7565&#xff0c;\u6700\u540e\u5728 PC\/2in1 \u6216\u6a21\u62df\u5668\u5c0f\u7a97\u91cc\u53cd\u590d\u7f29\u653e&#xff0c;\u786e\u8ba4 pageWidth \u9608\u503c\u6bd4\u5355\u7eaf\u65ad\u70b9\u66f4\u7a33\u3002<\/p>\n<h3>13. \u5e38\u89c1\u95ee\u9898\u548c\u4fee\u590d\u65b9\u5411<\/h3>\n<table>\n<tr>\u73b0\u8c61\u5148\u770b\u54ea\u91cc\u53ef\u80fd\u539f\u56e0\u4fee\u590d\u65b9\u5411<\/tr>\n<tbody>\n<tr>\n<td>\u9875\u9762\u4e00\u76f4\u6309\u624b\u673a\u5e03\u5c40\u663e\u793a<\/td>\n<td>BreakpointSystem.register() \u662f\u5426\u6267\u884c<\/td>\n<td>Ability \u672a\u6ce8\u518c\u6216\u521d\u59cb\u5224\u65ad\u672a\u5199\u5165<\/td>\n<td>\u786e\u8ba4 EntryAbility.onCreate() \u8c03\u7528 register()<\/td>\n<\/tr>\n<tr>\n<td>\u5927\u5c4f\u5217\u8868\u6ca1\u6709\u53d8\u7f51\u683c<\/td>\n<td>currentBp \u548c pageWidth<\/td>\n<td>\u5bbd\u5ea6\u672a\u8fbe\u5230 700&#xff0c;\u6216 onAreaChange \u672a\u66f4\u65b0<\/td>\n<td>\u6253\u5370\u9875\u9762\u5bbd\u5ea6&#xff0c;\u786e\u8ba4\u5bb9\u5668\u800c\u975e\u8bbe\u5907\u5bbd\u5ea6<\/td>\n<\/tr>\n<tr>\n<td>\u5e95\u90e8\u5bfc\u822a\u906e\u6321\u7cfb\u7edf\u624b\u52bf\u533a<\/td>\n<td>navigationIndicatorHeightPx<\/td>\n<td>\u5b89\u5168\u533a\u6ca1\u6709\u5199\u5165\u6216\u5355\u4f4d\u8f6c\u6362\u9519\u8bef<\/td>\n<td>\u590d\u6838 EntryAbility \u907f\u8ba9\u533a\u8bfb\u53d6\u548c\u9875\u9762 px2vp<\/td>\n<\/tr>\n<tr>\n<td>\u4fa7\u8fb9\u5bfc\u822a\u6ca1\u6709\u51fa\u73b0<\/td>\n<td>Index.ets \u6761\u4ef6<\/td>\n<td>sm\/md\/lg \u90fd\u547d\u4e2d\u5e95\u90e8\u5bfc\u822a\u5206\u652f<\/td>\n<td>\u628a lg \u5206\u652f\u5355\u72ec\u62c6\u51fa&#xff0c;\u6216\u589e\u52a0 PC \u5f62\u6001\u5224\u65ad<\/td>\n<\/tr>\n<tr>\n<td>\u8be6\u60c5\u9875\u5bbd\u5c4f\u8fc7\u65e9\u51fa\u73b0<\/td>\n<td>useWideLayout() \u9608\u503c<\/td>\n<td>\u9608\u503c\u4e0d\u9002\u5408\u5f53\u524d\u5185\u5bb9\u5bc6\u5ea6<\/td>\n<td>\u8c03\u6574 pageWidth &gt;&#061; 700 \u6216\u6309\u5185\u5bb9\u533a\u5bbd\u5ea6\u5224\u65ad<\/td>\n<\/tr>\n<tr>\n<td>\u5206\u7c7b\u9875\u5361\u7247\u6324\u538b<\/td>\n<td>itemWidth() \u548c Flex \u95f4\u8ddd<\/td>\n<td>\u767e\u5206\u6bd4\u4e0e\u95f4\u8ddd\u5408\u8ba1\u8fc7\u5927<\/td>\n<td>\u8c03\u6574 24%\/48% \u6216\u7edf\u4e00\u95f4\u8ddd token<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5176\u4e2d\u6700\u503c\u5f97\u4f18\u5148\u5904\u7406\u7684\u662f\u4fa7\u8fb9\u5bfc\u822a\u6761\u4ef6\u3002\u5f53\u524d\u4ee3\u7801\u4fdd\u7559\u4e86\u4fa7\u8fb9\u5bfc\u822a\u6784\u5efa\u51fd\u6570&#xff0c;\u4f46\u6761\u4ef6\u4e0d\u53ef\u8fbe\u3002\u8fd9\u4e2a\u95ee\u9898\u4e0d\u4f1a\u5f71\u54cd\u5e95\u90e8\u5bfc\u822a\u7684\u53ef\u7528\u6027&#xff0c;\u5374\u4f1a\u5f71\u54cd\u5bf9\u201cPC\/2in1 \u5bfc\u822a\u5f62\u6001\u201d\u7684\u58f0\u660e\u3002\u4e0a\u7ebf\u6750\u6599\u6216\u6280\u672f\u6587\u7ae0\u4e2d\u5fc5\u987b\u6309\u771f\u5b9e\u72b6\u6001\u8868\u8ff0&#xff0c;\u907f\u514d\u628a\u5907\u7528\u4ee3\u7801\u8bf4\u6210\u5df2\u7ecf\u751f\u6548\u3002<\/p>\n<h3>14. \u53ef\u4ee5\u843d\u5730\u7684\u6539\u8fdb\u5efa\u8bae<\/h3>\n<p>\u5982\u679c\u540e\u7eed\u8981\u7ee7\u7eed\u589e\u5f3a\u7b14\u4e0b\u751f\u8f89\u7684\u591a\u8bbe\u5907\u5e03\u5c40&#xff0c;\u5efa\u8bae\u6309\u98ce\u9669\u4ece\u4f4e\u5230\u9ad8\u63a8\u8fdb\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65&#xff0c;\u628a Index.ets \u7684\u5bfc\u822a\u6761\u4ef6\u6539\u6e05\u695a\u3002\u4f8b\u5982&#xff1a;<\/p>\n<p>private useSideNav(): boolean {<br \/>\n  return this.currentBp &#061;&#061;&#061; &#039;lg&#039;;<br \/>\n}<\/p>\n<p>build() {<br \/>\n  if (this.useSideNav()) {<br \/>\n    Row() {<br \/>\n      this.buildSideNav()<br \/>\n      this.buildCurrentPage()<br \/>\n    }<br \/>\n  } else {<br \/>\n    Column() {<br \/>\n      Stack() {<br \/>\n        this.buildCurrentPage()<br \/>\n      }<br \/>\n      .layoutWeight(1)<\/p>\n<p>      this.buildBottomNav()<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<p>\u8fd9\u6bb5\u53ea\u662f\u6539\u8fdb\u65b9\u5411&#xff0c;\u4e0d\u662f\u5f53\u524d\u6e90\u7801\u5df2\u7ecf\u91c7\u7528\u7684\u5b9e\u73b0\u3002\u5b83\u7684\u597d\u5904\u662f\u8ba9\u5bfc\u822a\u5f62\u6001\u548c\u65ad\u70b9\u5173\u7cfb\u53ef\u8bfb&#xff0c;\u4e5f\u907f\u514d else \u5206\u652f\u957f\u671f\u4e0d\u53ef\u8fbe\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65&#xff0c;\u628a 700\u3001720\u3001840 \u7b49\u5173\u952e\u9608\u503c\u6c89\u6dc0\u6210\u547d\u540d\u5e38\u91cf\u3002\u73b0\u5728\u8fd9\u4e9b\u9608\u503c\u6563\u843d\u5728\u9875\u9762\u548c\u65ad\u70b9\u7cfb\u7edf\u4e2d&#xff0c;\u4ecd\u7136\u53ef\u4ee5\u8bfb\u61c2&#xff1b;\u5f53\u9875\u9762\u7ee7\u7eed\u589e\u52a0\u65f6&#xff0c;\u5efa\u8bae\u4f7f\u7528\u7c7b\u4f3c AdaptiveLayoutTokens.WIDE_PAGE_MIN_WIDTH \u7684\u65b9\u5f0f\u96c6\u4e2d\u8bf4\u660e\u3002<\/p>\n<p>\u7b2c\u4e09\u6b65&#xff0c;\u7ed9 lg \u4e0b\u7684\u5c0f\u7a97\u56de\u9000\u505a\u66f4\u660e\u786e\u7684\u9a8c\u8bc1\u3002\u6e90\u7801\u5df2\u7ecf\u7528 pageWidth \u5904\u7406\u4e86\u8fd9\u4e00\u70b9&#xff0c;\u4f46\u9a8c\u6536\u65f6\u8981\u628a\u201c\u8bbe\u5907\u662f\u5927\u5c4f&#xff0c;\u4f46\u7a97\u53e3\u662f\u7a84\u7684\u201d\u5355\u72ec\u5217\u51fa\u6765\u3002PC\/2in1 \u7528\u6237\u7ecf\u5e38\u628a\u7a97\u53e3\u62d6\u6210\u534a\u5c4f&#xff0c;\u5355\u7eaf\u770b\u8bbe\u5907\u7c7b\u578b\u5e76\u4e0d\u591f\u3002<\/p>\n<h3>15. \u5c0f\u7ed3<\/h3>\n<p>\u7b14\u4e0b\u751f\u8f89\u8fd9\u7bc7\u591a\u8bbe\u5907\u5e03\u5c40\u7684\u6e90\u7801\u4ef7\u503c&#xff0c;\u5728\u4e8e\u5b83\u6ca1\u6709\u628a\u9002\u914d\u5199\u6210\u4e00\u53e5\u7b3c\u7edf\u7684\u201c\u5927\u5c4f\u9002\u914d\u201d\u3002BreakpointSystem \u8d1f\u8d23\u5168\u5c40\u65ad\u70b9&#xff0c;EntryAbility \u8d1f\u8d23\u751f\u547d\u5468\u671f\u548c\u5b89\u5168\u533a&#xff0c;\u9875\u9762\u901a\u8fc7 &#064;StorageLink\u3001onAreaChange\u3001pageWidth \u51b3\u5b9a\u5177\u4f53\u5e03\u5c40\u3002\u5217\u8868\u9875\u3001\u9996\u9875\u3001\u9898\u5e93\u9875\u3001\u7edf\u8ba1\u9875\u7528 lg &amp;&amp; pageWidth &gt;&#061; 700 \u8fdb\u5165\u7f51\u683c\u6216\u5bbd\u5c4f\u72b6\u6001&#xff1b;\u8be6\u60c5\u9875\u7528\u540c\u6837\u601d\u8def\u63a7\u5236\u9605\u8bfb\u533a\u57df&#xff1b;\u5206\u7c7b\u9875\u5219\u76f4\u63a5\u6309\u5bb9\u5668\u5bbd\u5ea6\u8c03\u6574\u5361\u7247\u6bd4\u4f8b&#xff1b;\u7ed3\u679c\u9875\u91cd\u70b9\u5904\u7406\u5e95\u90e8\u5b89\u5168\u533a\u3002<\/p>\n<p>\u540c\u65f6&#xff0c;\u6e90\u7801\u4e5f\u66b4\u9732\u4e86\u4e00\u4e2a\u660e\u786e\u8fb9\u754c&#xff1a;Index.ets \u7684\u4fa7\u8fb9\u5bfc\u822a\u5206\u652f\u5f53\u524d\u4e0d\u4f1a\u88ab sm\u3001md\u3001lg \u89e6\u8fbe\u3002\u5de5\u7a0b\u6587\u7ae0\u5e94\u8be5\u628a\u8fd9\u79cd\u8fb9\u754c\u5199\u6e05\u695a&#xff0c;\u56e0\u4e3a\u771f\u5b9e\u53ef\u590d\u6838\u6bd4\u8bf4\u5f97\u5b8c\u6574\u66f4\u91cd\u8981\u3002\u5bf9\u4e8e HarmonyOS 5.0&#043; \u591a\u8bbe\u5907\u5f00\u53d1&#xff0c;\u53ef\u9760\u7684\u9002\u914d\u4e0d\u662f\u591a\u5199\u51e0\u4e2a\u5206\u652f&#xff0c;\u800c\u662f\u8ba9\u65ad\u70b9\u3001\u5bb9\u5668\u5bbd\u5ea6\u3001\u5b89\u5168\u533a\u5404\u81ea\u627f\u62c5\u6e05\u6670\u804c\u8d23&#xff0c;\u5e76\u5728\u7a97\u53e3\u53d8\u5316\u65f6\u4fdd\u6301\u9875\u9762\u72b6\u6001\u53ef\u9884\u6d4b\u3002<\/p>\n<p>\u672c\u6587\u5185\u5bb9\u57fa\u4e8e\u7b14\u4e0b\u751f\u8f89\u9879\u76ee\u4e2d BreakpointSystem.ets\u3001EntryAbility.ets\u3001Index.ets\u3001BankListPage.ets\u3001BankDetailPage.ets\u3001CategoryPage.ets\u3001ExamResultPage.ets\u3001HakkaBankPage.ets \u7b49\u771f\u5b9e\u6e90\u7801\u6574\u7406&#xff1b;\u90e8\u5206\u5185\u5bb9\u7531 AI \u8f85\u52a9\u751f\u6210&#xff0c;\u6700\u7ec8\u4ee5\u6e90\u7801\u590d\u6838\u548c\u4eba\u5de5\u6821\u5bf9\u4e3a\u51c6\u3002\u672c\u7bc7\u6587\u7ae0\u4f7f\u7528\u72ec\u7acb\u5c01\u9762 media\/cover.png&#xff0c;\u5e94\u7528\u5408\u96c6\u5c01\u9762\u590d\u7528 06-\u7b14\u4e0b\u751f\u8f89\/media\/collection-cover.png\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b9e\u9645\u505a HarmonyOS 5.0 \u5e94\u7528\u65f6&#xff0c;\u591a\u8bbe\u5907\u9002\u914d\u6700\u5bb9\u6613\u51fa\u95ee\u9898\u7684\u5730\u65b9\u4e0d\u662f\u201c\u6709\u6ca1\u6709\u5199\u54cd\u5e94\u5f0f\u5e03\u5c40\u201d\u8fd9\u53e5\u8bdd&#xff0c;\u800c\u662f\u7a97\u53e3\u53d8\u5316\u53d1\u751f\u4ee5\u540e&#xff0c;\u9875\u9762\u5230\u5e95\u7531\u8c01\u611f\u77e5\u3001\u8c01\u4fdd\u5b58\u72b6\u6001\u3001\u8c01\u51b3\u5b9a\u5e03\u5c40\u3001\u8c01\u5904\u7406\u5b89\u5168\u533a\u3002\u7b14\u4e0b\u751f\u8f89\u8fd9\u5957\u6e90\u7801\u628a\u9002\u914d\u62c6\u6210\u4e86\u4e09\u4e2a\u53ef\u590d\u6838\u7684\u70b9&#xff1a;BreakpointSystem \u7528 mediaquery \u4ea7\u51fa sm\u3001md\u3001lg \u65ad\u70b9&#xff0c;EntryAbility \u628a\u9876\u90e8\u548c\u5e95\u90e8\u907f\u8ba9\u533a\u5199\u8fdb AppStorage&#xff0c;\u5404\u9875\u9762<\/p>\n","protected":false},"author":2,"featured_media":88367,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10018,9950,10019,4362,280],"topic":[],"class_list":["post-88370","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-10018","tag-9950","tag-10019","tag-arkts","tag-harmonyos"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010\u7b14\u4e0b\u751f\u8f89\uff5c16\u3011HarmonyOS ArkTS \u591a\u8bbe\u5907\u5e03\u5c40\u5b9e\u6218\uff1a\u9002\u914d\u624b\u673a\u3001\u5e73\u677f\u548c PC\/2in1 \u7684\u7a97\u53e3\u53d8\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/88370.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010\u7b14\u4e0b\u751f\u8f89\uff5c16\u3011HarmonyOS ArkTS \u591a\u8bbe\u5907\u5e03\u5c40\u5b9e\u6218\uff1a\u9002\u914d\u624b\u673a\u3001\u5e73\u677f\u548c PC\/2in1 \u7684\u7a97\u53e3\u53d8\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5b9e\u9645\u505a HarmonyOS 5.0 \u5e94\u7528\u65f6&#xff0c;\u591a\u8bbe\u5907\u9002\u914d\u6700\u5bb9\u6613\u51fa\u95ee\u9898\u7684\u5730\u65b9\u4e0d\u662f\u201c\u6709\u6ca1\u6709\u5199\u54cd\u5e94\u5f0f\u5e03\u5c40\u201d\u8fd9\u53e5\u8bdd&#xff0c;\u800c\u662f\u7a97\u53e3\u53d8\u5316\u53d1\u751f\u4ee5\u540e&#xff0c;\u9875\u9762\u5230\u5e95\u7531\u8c01\u611f\u77e5\u3001\u8c01\u4fdd\u5b58\u72b6\u6001\u3001\u8c01\u51b3\u5b9a\u5e03\u5c40\u3001\u8c01\u5904\u7406\u5b89\u5168\u533a\u3002\u7b14\u4e0b\u751f\u8f89\u8fd9\u5957\u6e90\u7801\u628a\u9002\u914d\u62c6\u6210\u4e86\u4e09\u4e2a\u53ef\u590d\u6838\u7684\u70b9&#xff1a;BreakpointSystem \u7528 mediaquery \u4ea7\u51fa sm\u3001md\u3001lg \u65ad\u70b9&#xff0c;EntryAbility \u628a\u9876\u90e8\u548c\u5e95\u90e8\u907f\u8ba9\u533a\u5199\u8fdb AppStorage&#xff0c;\u5404\u9875\u9762\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/88370.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-31T18:56:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260731185637-6a6cefe5aae03.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/88370.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/88370.html\",\"name\":\"\u3010\u7b14\u4e0b\u751f\u8f89\uff5c16\u3011HarmonyOS ArkTS \u591a\u8bbe\u5907\u5e03\u5c40\u5b9e\u6218\uff1a\u9002\u914d\u624b\u673a\u3001\u5e73\u677f\u548c PC\/2in1 \u7684\u7a97\u53e3\u53d8\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-31T18:56:40+00:00\",\"dateModified\":\"2026-07-31T18:56:40+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/88370.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/88370.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/88370.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010\u7b14\u4e0b\u751f\u8f89\uff5c16\u3011HarmonyOS ArkTS \u591a\u8bbe\u5907\u5e03\u5c40\u5b9e\u6218\uff1a\u9002\u914d\u624b\u673a\u3001\u5e73\u677f\u548c PC\/2in1 \u7684\u7a97\u53e3\u53d8\u5316\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010\u7b14\u4e0b\u751f\u8f89\uff5c16\u3011HarmonyOS ArkTS \u591a\u8bbe\u5907\u5e03\u5c40\u5b9e\u6218\uff1a\u9002\u914d\u624b\u673a\u3001\u5e73\u677f\u548c PC\/2in1 \u7684\u7a97\u53e3\u53d8\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/88370.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010\u7b14\u4e0b\u751f\u8f89\uff5c16\u3011HarmonyOS ArkTS \u591a\u8bbe\u5907\u5e03\u5c40\u5b9e\u6218\uff1a\u9002\u914d\u624b\u673a\u3001\u5e73\u677f\u548c PC\/2in1 \u7684\u7a97\u53e3\u53d8\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5b9e\u9645\u505a HarmonyOS 5.0 \u5e94\u7528\u65f6&#xff0c;\u591a\u8bbe\u5907\u9002\u914d\u6700\u5bb9\u6613\u51fa\u95ee\u9898\u7684\u5730\u65b9\u4e0d\u662f\u201c\u6709\u6ca1\u6709\u5199\u54cd\u5e94\u5f0f\u5e03\u5c40\u201d\u8fd9\u53e5\u8bdd&#xff0c;\u800c\u662f\u7a97\u53e3\u53d8\u5316\u53d1\u751f\u4ee5\u540e&#xff0c;\u9875\u9762\u5230\u5e95\u7531\u8c01\u611f\u77e5\u3001\u8c01\u4fdd\u5b58\u72b6\u6001\u3001\u8c01\u51b3\u5b9a\u5e03\u5c40\u3001\u8c01\u5904\u7406\u5b89\u5168\u533a\u3002\u7b14\u4e0b\u751f\u8f89\u8fd9\u5957\u6e90\u7801\u628a\u9002\u914d\u62c6\u6210\u4e86\u4e09\u4e2a\u53ef\u590d\u6838\u7684\u70b9&#xff1a;BreakpointSystem \u7528 mediaquery \u4ea7\u51fa sm\u3001md\u3001lg \u65ad\u70b9&#xff0c;EntryAbility \u628a\u9876\u90e8\u548c\u5e95\u90e8\u907f\u8ba9\u533a\u5199\u8fdb AppStorage&#xff0c;\u5404\u9875\u9762","og_url":"https:\/\/www.wsisp.com\/helps\/88370.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-31T18:56:40+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260731185637-6a6cefe5aae03.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/88370.html","url":"https:\/\/www.wsisp.com\/helps\/88370.html","name":"\u3010\u7b14\u4e0b\u751f\u8f89\uff5c16\u3011HarmonyOS ArkTS \u591a\u8bbe\u5907\u5e03\u5c40\u5b9e\u6218\uff1a\u9002\u914d\u624b\u673a\u3001\u5e73\u677f\u548c PC\/2in1 \u7684\u7a97\u53e3\u53d8\u5316 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-31T18:56:40+00:00","dateModified":"2026-07-31T18:56:40+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/88370.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/88370.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/88370.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010\u7b14\u4e0b\u751f\u8f89\uff5c16\u3011HarmonyOS ArkTS \u591a\u8bbe\u5907\u5e03\u5c40\u5b9e\u6218\uff1a\u9002\u914d\u624b\u673a\u3001\u5e73\u677f\u548c PC\/2in1 \u7684\u7a97\u53e3\u53d8\u5316"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/88370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=88370"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/88370\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/88367"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=88370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=88370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=88370"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=88370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}