{"id":51691,"date":"2025-08-11T03:39:09","date_gmt":"2025-08-10T19:39:09","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/51691.html"},"modified":"2025-08-11T03:39:09","modified_gmt":"2025-08-10T19:39:09","slug":"%e9%b8%bf%e8%92%99arkui%e4%b8%ad%e7%9a%84button%e7%bb%84%e4%bb%b6%e5%85%a8%e9%9d%a2%e8%a7%a3%e6%9e%90%ef%bc%9a%e4%bb%8e%e5%9f%ba%e7%a1%80%e5%88%b0%e9%ab%98%e7%ba%a7%e5%ba%94%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/51691.html","title":{"rendered":"\u9e3f\u8499ArkUI\u4e2d\u7684Button\u7ec4\u4ef6\u5168\u9762\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E5%89%8D%E8%A8%80-toc\" style=\"margin-left:0px\">\u524d\u8a00<\/p>\n<p id=\"%E4%B8%80%E3%80%81Button%E7%BB%84%E4%BB%B6%E5%9F%BA%E7%A1%80-toc\" style=\"margin-left:0px\">\u4e00\u3001Button\u7ec4\u4ef6\u57fa\u7840<\/p>\n<p id=\"1.%E6%8C%89%E9%92%AE%E7%9A%84%E5%9F%BA%E6%9C%AC%E5%88%9B%E5%BB%BA%E6%96%B9%E5%BC%8F-toc\" style=\"margin-left:40px\">1.\u6309\u94ae\u7684\u57fa\u672c\u521b\u5efa\u65b9\u5f0f<\/p>\n<p id=\"1.%20%E6%97%A0%E5%8F%82%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0-toc\" style=\"margin-left:80px\">1. \u65e0\u53c2\u6784\u9020\u51fd\u6570<\/p>\n<p id=\"2.%20%E5%B8%A6%E9%80%89%E9%A1%B9%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0-toc\" style=\"margin-left:80px\">2. \u5e26\u9009\u9879\u6784\u9020\u51fd\u6570<\/p>\n<p id=\"3.%20%E5%B8%A6%E6%A0%87%E7%AD%BE%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0-toc\" style=\"margin-left:80px\">3. \u5e26\u6807\u7b7e\u6784\u9020\u51fd\u6570<\/p>\n<p id=\"2.%20%E6%A0%B8%E5%BF%83%E5%B1%9E%E6%80%A7-toc\" style=\"margin-left:40px\">2. \u6838\u5fc3\u5c5e\u6027<\/p>\n<p id=\"%E4%BA%8C%E3%80%81Button%E6%A0%B7%E5%BC%8F%E5%AE%9A%E5%88%B6-toc\" style=\"margin-left:0px\">\u4e8c\u3001Button\u6837\u5f0f\u5b9a\u5236<\/p>\n<p id=\"1.%20%E9%A2%84%E5%AE%9A%E4%B9%89%E6%A0%B7%E5%BC%8F%E7%B1%BB%E5%9E%8B-toc\" style=\"margin-left:40px\">1. \u9884\u5b9a\u4e49\u6837\u5f0f\u7c7b\u578b<\/p>\n<p id=\"2.%20%E8%87%AA%E5%AE%9A%E4%B9%89%E6%A0%B7%E5%BC%8F-toc\" style=\"margin-left:40px\">2. \u81ea\u5b9a\u4e49\u6837\u5f0f<\/p>\n<p id=\"2.1%20%E5%9F%BA%E7%A1%80%E6%A0%B7%E5%BC%8F-toc\" style=\"margin-left:80px\">2.1 \u57fa\u7840\u6837\u5f0f<\/p>\n<p id=\"2.2%20%E4%BD%BF%E7%94%A8%40Styles%E6%8A%BD%E8%B1%A1%E6%A0%B7%E5%BC%8F-toc\" style=\"margin-left:80px\">2.2 \u4f7f\u7528@Styles\u62bd\u8c61\u6837\u5f0f<\/p>\n<p id=\"2.3%20%E7%8A%B6%E6%80%81%E6%A0%B7%E5%BC%8F-toc\" style=\"margin-left:80px\">2.3 \u72b6\u6001\u6837\u5f0f<\/p>\n<p id=\"%E4%B8%89%E3%80%81Button%E4%BA%A4%E4%BA%92%E5%8A%9F%E8%83%BD-toc\" style=\"margin-left:0px\">\u4e09\u3001Button\u4ea4\u4e92\u529f\u80fd<\/p>\n<p id=\"1.%20%E7%82%B9%E5%87%BB%E4%BA%8B%E4%BB%B6%E5%A4%84%E7%90%86-toc\" style=\"margin-left:80px\">1. \u70b9\u51fb\u4e8b\u4ef6\u5904\u7406<\/p>\n<p id=\"2.%20%E6%8C%89%E9%92%AE%E7%9A%84%E4%BA%8B%E4%BB%B6%E7%B1%BB%E5%9E%8B-toc\" style=\"margin-left:80px\">2. \u6309\u94ae\u7684\u4e8b\u4ef6\u7c7b\u578b<\/p>\n<p id=\"3.%20%E7%A6%81%E7%94%A8%E7%8A%B6%E6%80%81-toc\" style=\"margin-left:80px\">3. \u7981\u7528\u72b6\u6001<\/p>\n<p id=\"%E5%9B%9B%E3%80%81%E9%AB%98%E7%BA%A7Button%E7%94%A8%E6%B3%95-toc\" style=\"margin-left:0px\">\u56db\u3001\u9ad8\u7ea7Button\u7528\u6cd5<\/p>\n<p id=\"1.%20%E8%87%AA%E5%AE%9A%E4%B9%89%E5%86%85%E5%AE%B9Button-toc\" style=\"margin-left:40px\">1. \u81ea\u5b9a\u4e49\u5185\u5bb9Button<\/p>\n<p id=\"2.%20%E6%8C%89%E9%92%AE%E7%BB%84%E5%AE%9E%E7%8E%B0-toc\" style=\"margin-left:40px\">2. \u6309\u94ae\u7ec4\u5b9e\u73b0<\/p>\n<p id=\"3.%20%E5%8A%A8%E6%80%81%E6%8C%89%E9%92%AE%E5%86%85%E5%AE%B9-toc\" style=\"margin-left:40px\">3. \u52a8\u6001\u6309\u94ae\u5185\u5bb9<\/p>\n<p id=\"%E4%BA%94%E3%80%81Button%E5%8A%A8%E6%95%88%E5%AE%9E%E7%8E%B0-toc\" style=\"margin-left:0px\">\u4e94\u3001Button\u52a8\u6548\u5b9e\u73b0<\/p>\n<p id=\"1.%20%E7%BC%A9%E6%94%BE%E5%8A%A8%E7%94%BB-toc\" style=\"margin-left:40px\">1. \u7f29\u653e\u52a8\u753b<\/p>\n<p id=\"2.%20%E9%A2%9C%E8%89%B2%E6%B8%90%E5%8F%98%E5%8A%A8%E7%94%BB-toc\" style=\"margin-left:40px\">2. \u989c\u8272\u6e10\u53d8\u52a8\u753b<\/p>\n<p id=\"%E5%85%AD%E3%80%81Button%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5-toc\" style=\"margin-left:0px\">\u516d\u3001Button\u6700\u4f73\u5b9e\u8df5<\/p>\n<p id=\"1.%20%E5%85%A8%E5%B1%80%E6%8C%89%E9%92%AE%E6%A0%B7%E5%BC%8F%E7%AE%A1%E7%90%86-toc\" style=\"margin-left:40px\">1. \u5168\u5c40\u6309\u94ae\u6837\u5f0f\u7ba1\u7406<\/p>\n<p id=\"2.%20%E6%8C%89%E9%92%AE%E7%82%B9%E5%87%BB%E9%98%B2%E6%8A%96-toc\" style=\"margin-left:40px\">2. \u6309\u94ae\u70b9\u51fb\u9632\u6296<\/p>\n<p id=\"3.%20%E6%8C%89%E9%92%AE%E4%B8%BB%E9%A2%98%E9%80%82%E9%85%8D-toc\" style=\"margin-left:40px\">3. \u6309\u94ae\u4e3b\u9898\u9002\u914d<\/p>\n<p id=\"%E4%B8%83%E3%80%81%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88-toc\" style=\"margin-left:0px\">\u4e03\u3001\u5e38\u89c1\u95ee\u9898\u89e3\u51b3\u65b9\u6848<\/p>\n<p id=\"1.%20%E6%8C%89%E9%92%AE%E7%82%B9%E5%87%BB%E6%97%A0%E5%93%8D%E5%BA%94-toc\" style=\"margin-left:40px\">1. \u6309\u94ae\u70b9\u51fb\u65e0\u54cd\u5e94<\/p>\n<p id=\"2.%20%E6%8C%89%E9%92%AE%E6%A0%B7%E5%BC%8F%E4%B8%8D%E7%94%9F%E6%95%88-toc\" style=\"margin-left:40px\">2. \u6309\u94ae\u6837\u5f0f\u4e0d\u751f\u6548<\/p>\n<p id=\"3.%20%E6%8C%89%E9%92%AE%E5%86%85%E5%AE%B9%E5%B8%83%E5%B1%80%E5%BC%82%E5%B8%B8-toc\" style=\"margin-left:40px\">3. \u6309\u94ae\u5185\u5bb9\u5e03\u5c40\u5f02\u5e38<\/p>\n<p id=\"%E5%85%AB%E3%80%81%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96%E5%BB%BA%E8%AE%AE-toc\" style=\"margin-left:0px\">\u516b\u3001\u6027\u80fd\u4f18\u5316\u5efa\u8bae<\/p>\n<p id=\"%E4%B9%9D%E3%80%81Button%E7%BB%84%E4%BB%B6%E8%AE%BE%E8%AE%A1%E8%A7%84%E8%8C%83-toc\" style=\"margin-left:0px\">\u4e5d\u3001Button\u7ec4\u4ef6\u8bbe\u8ba1\u89c4\u8303<\/p>\n<p id=\"%E5%8D%81%E3%80%81Button%E4%B8%8E%E5%85%B6%E4%BB%96%E7%BB%84%E4%BB%B6%E7%BB%84%E5%90%88-toc\" style=\"margin-left:0px\">\u5341\u3001Button\u4e0e\u5176\u4ed6\u7ec4\u4ef6\u7ec4\u5408<\/p>\n<p id=\"1.%20%E4%B8%8EPopup%E7%BB%84%E5%90%88-toc\" style=\"margin-left:40px\">1. \u4e0ePopup\u7ec4\u5408<\/p>\n<p id=\"2.%20%E4%B8%8EList%E7%BB%84%E5%90%88-toc\" style=\"margin-left:40px\">2. \u4e0eList\u7ec4\u5408<\/p>\n<p id=\"3.%20%E4%B8%8EScroll%E7%BB%84%E5%90%88-toc\" style=\"margin-left:40px\">3. \u4e0eScroll\u7ec4\u5408<\/p>\n<hr id=\"hr-toc\">\n<h2>\u524d\u8a00<\/h2>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Button\uff08\u6309\u94ae\uff09\u4f5c\u4e3a\u7528\u6237\u754c\u9762\u4e2d\u6700\u57fa\u7840\u7684\u4ea4\u4e92\u7ec4\u4ef6\u4e4b\u4e00\uff0c\u5728\u9e3f\u8499\uff08HarmonyOS\uff09\u5e94\u7528\u5f00\u53d1\u4e2d\u626e\u6f14\u7740\u81f3\u5173\u91cd\u8981\u7684\u89d2\u8272\u3002ArkUI\u6846\u67b6\u63d0\u4f9b\u4e86\u5f3a\u5927\u800c\u7075\u6d3b\u7684Button\u7ec4\u4ef6\uff0c\u652f\u6301\u4e30\u5bcc\u7684\u6837\u5f0f\u5b9a\u5236\u548c\u4ea4\u4e92\u529f\u80fd\u3002\u672c\u6587\u5c06\u6df1\u5165\u63a2\u8ba8Button\u7ec4\u4ef6\u7684\u5404\u79cd\u7279\u6027\u548c\u4f7f\u7528\u6280\u5de7\u3002<\/p>\n<h2 id=\"%E4%B8%80%E3%80%81Button%E7%BB%84%E4%BB%B6%E5%9F%BA%E7%A1%80\">\u4e00\u3001Button\u7ec4\u4ef6\u57fa\u7840<\/h2>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u6211\u4eec\u5148\u770b\u4e00\u4e0bArkUI\u4e2dButton\u7684\u5b9a\u4e49\uff1a<\/p>\n<p>declare const Button: ButtonInterface;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; Button\u662f\u4e00\u4e2a\u7c7b\u578b\u4e3aButtonInterface\u7684\u5e38\u91cf\u3002<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u6211\u4eec\u7ee7\u7eed\u770b\u4e00\u4e0bButtonInterface\u7684\u5b9a\u4e49\uff1a<\/p>\n<p>interface ButtonInterface {<br \/>\n   &nbsp; &nbsp; (): ButtonAttribute; &nbsp; &nbsp; (options: ButtonOptions): ButtonAttribute; &nbsp; &nbsp; (label: ResourceStr, options?: ButtonOptions): ButtonAttribute; }&nbsp; &nbsp; &nbsp;&nbsp;<\/p>\n<p>&nbsp; &nbsp; \u4eceButtonInterface\u7684\u5b9a\u4e49\u53ef\u4ee5\u77e5\u9053\uff0cButton\u63d0\u4f9b\u4e86\u4e09\u79cd\u521b\u5efa\u6309\u94ae\u7684\u65b9\u5f0f&nbsp;<\/p>\n<p>&nbsp; &nbsp; ButtonInterface&nbsp;\u662f\u9e3f\u8499 ArkUI \u6846\u67b6\u4e2d\u5b9a\u4e49\u6309\u94ae\u7ec4\u4ef6\u884c\u4e3a\u7684\u63a5\u53e3\uff0c\u5b83\u63d0\u4f9b\u4e86\u591a\u79cd\u521b\u5efa\u6309\u94ae\u7684\u65b9\u5f0f\u3002\u4e0b\u9762\u6211\u5c06\u89e3\u91ca\u8fd9\u4e2a\u63a5\u53e3\u7684\u6838\u5fc3\u7ed3\u6784\u548c\u529f\u80fd\u3002<\/p>\n<h3 id=\"1.%E6%8C%89%E9%92%AE%E7%9A%84%E5%9F%BA%E6%9C%AC%E5%88%9B%E5%BB%BA%E6%96%B9%E5%BC%8F\">1.\u6309\u94ae\u7684\u57fa\u672c\u521b\u5efa\u65b9\u5f0f<\/h3>\n<h4 id=\"1.%20%E6%97%A0%E5%8F%82%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0\">1. \u65e0\u53c2\u6784\u9020\u51fd\u6570<\/h4>\n<p>(): ButtonAttribute <\/p>\n<p>\u200b &nbsp; &nbsp; &nbsp; &nbsp;\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u65e0\u53c2\u6784\u9020\u51fd\u6570\u521b\u5efa\u4e00\u4e2a\u7a7a\u5185\u5bb9\u7684\u6309\u94ae\uff0c\u8fd4\u56de&nbsp;ButtonAttribute&nbsp;\u7528\u4e8e\u540e\u7eed\u5c5e\u6027\u8bbe\u7f6e\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>Button().width(100).height(30).borderRadius(15) <\/p>\n<h4 id=\"2.%20%E5%B8%A6%E9%80%89%E9%A1%B9%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0\">2. \u5e26\u9009\u9879\u6784\u9020\u51fd\u6570<\/h4>\n<p>(options: ButtonOptions): ButtonAttribute <\/p>\n<p>\u200b &nbsp; &nbsp; &nbsp; &nbsp;\u8fd9\u79cd\u65b9\u5f0f\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u5bf9\u8c61\u521b\u5efa\u6309\u94ae\u3002<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u6211\u4eec\u53ef\u4ee5\u8bbe\u7f6e\u6309\u94ae\u7c7b\u578b\u7b49\u5c5e\u6027\u3002<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u4f8b\u5982\u5728\u4e0b\u9762\u7684\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u8bbe\u7f6e\u6309\u94ae\u4e3a\u539f\u578b\u6309\u94ae\u3002<\/p>\n<p>      Button({type:ButtonType.Circle}).width(100).height(30).borderRadius(15).margin({top:20})<\/p>\n<h4 id=\"3.%20%E5%B8%A6%E6%A0%87%E7%AD%BE%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0\" style=\"background-color:transparent\">3. \u5e26\u6807\u7b7e\u6784\u9020\u51fd\u6570<\/h4>\n<p>(label: ResourceStr, options?: ButtonOptions): ButtonAttribute <\/p>\n<p>\u200b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u521b\u5efa\u5e26\u6709\u6587\u672c\u6807\u7b7e\u7684\u6309\u94ae<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u5176\u4e2dlabel\u8868\u793a\u6309\u94ae\u663e\u793a\u7684\u6587\u672c\u5185\u5bb9\uff08\u652f\u6301\u5b57\u7b26\u4e32\uff09\u3002<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp;options\u7c7b\u578b\u662f\u53ef\u9009\u7684\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u53c2\u6570\u914d\u7f6eButton\u5916\u89c2\u3002<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u4f8b\u5982\u4e0b\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u6807\u9898\u4e3a\\&#8221;\u70b9\u51fb\u6211\\&#8221;\u7684Button\u3002<\/p>\n<p>Button(\\&#8217;\u70b9\u51fb\u6211\\&#8217;, { type: ButtonType.Normal }) <\/p>\n<h3 id=\"2.%20%E6%A0%B8%E5%BF%83%E5%B1%9E%E6%80%A7\" style=\"background-color:transparent\">2. \u6838\u5fc3\u5c5e\u6027<\/h3>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u901a\u8fc7\u524d\u9762\u7684API\u6587\u6863\u53ef\u4ee5\u77e5\u9053\uff0c\u914d\u7f6e\u6309\u94ae\u4e3b\u8981\u662f\u901a\u8fc7options\u53c2\u6570\u7c7b\u914d\u7f6e\u6309\u94ae\uff0coption\u662f\u7ee7\u627f\u81eaButtonAttribute\u7684\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u4e00\u4e0bButtonAttribute\u7684\u5b9a\u4e49\u7684\u5c5e\u6027\u3002<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u6211\u5728\u4e0b\u9762\u7684\u5217\u8868\u4e2d\u5217\u51fa\u4e86ButtoAttribute\u5b9a\u4e49\u7684\u4e00\u4e9b\u5c5e\u6027\u3002<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u901a\u8fc7\u8bbe\u7f6e\u8fd9\u4e9b\u5c5e\u6027\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u914d\u7f6eButton\u5916\u89c2\u3002\u4e0b\u9762\u6211\u4eec\u4f1a\u9488\u5bf9\u8fd9\u4e9b\u5c5e\u6027\u8bb2\u89e3\u3002<\/p>\n<table>\n<tr>\n   \u5c5e\u6027\u540d<br \/>\n   \u7c7b\u578b<br \/>\n   \u63cf\u8ff0<br \/>\n   \u793a\u4f8b<br \/>\n  <\/tr>\n<tbody>\n<tr>\n<td>\n<p style=\"text-align:center\">type<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">ButtonType<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">\u6309\u94ae\u7c7b\u578b<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">ButtonType.Normal ButtonType.Capsule ButtonType.Circle<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p style=\"text-align:center\">stateEffect<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">boolean<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">\u662f\u5426\u542f\u7528\u6309\u538b\u6548\u679c<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">true(\u9ed8\u8ba4) false<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p style=\"text-align:center\">buttonStyle<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">ButtonStyleMode<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">\u6309\u94ae\u6837\u5f0f\u6a21\u5f0f<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">ButtonStyleMode.Standard ButtonStyleMode.Highlight<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p style=\"text-align:center\">controlSize<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">ControlSize<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">\u63a7\u4ef6\u5c3a\u5bf8<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">ControlSize.Small ControlSize.Medium ControlSize.Large<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p style=\"text-align:center\">role<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">ButtonRole<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">\u6309\u94ae\u89d2\u8272\/\u8bed\u4e49<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">ButtonRole.Normal ButtonRole.Destructive<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p style=\"text-align:center\">fontColor<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">ResourceColor<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">\u6587\u5b57\u989c\u8272<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">Color.Black #FF0000 $r(\\&#8217;app.color.primary\\&#8217;)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p style=\"text-align:center\">fontSize<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">Length<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">\u6587\u5b57\u5927\u5c0f<\/p>\n<\/td>\n<td>\n<p style=\"text-align:center\">16 \\&#8217;20vp\\&#8217;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p style=\"text-align:center\">fontWeight<\/p>\n<\/td>\n<td> <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u9e3f\u8499ArkUI\u6846\u67b6\u4e2dButton\u7ec4\u4ef6\u7684\u5f00\u53d1\u4e0e\u5e94\u7528\u3002\u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a1\uff09Button\u7684\u4e09\u79cd\u521b\u5efa\u65b9\u5f0f\u53ca\u6838\u5fc3\u5c5e\u6027\u914d\u7f6e\uff1b2\uff09\u6837\u5f0f\u5b9a\u5236\u65b9\u6cd5\uff0c\u5305\u62ec\u9884\u5b9a\u4e49\u6837\u5f0f\u548c\u81ea\u5b9a\u4e49\u6837\u5f0f\uff1b3\uff09\u4ea4\u4e92\u529f\u80fd\u5b9e\u73b0\uff0c\u5982\u70b9\u51fb\u4e8b\u4ef6\u5904\u7406\u548c\u72b6\u6001\u7ba1\u7406\uff1b4\uff09\u9ad8\u7ea7\u7528\u6cd5\uff0c\u5982\u81ea\u5b9a\u4e49\u5185\u5bb9\u3001\u6309\u94ae\u7ec4\u548c\u52a8\u6001\u6548\u679c\uff1b5\uff09\u5e38\u89c1\u95ee\u9898\u89e3\u51b3\u65b9\u6848\u548c\u6027\u80fd\u4f18\u5316\u5efa\u8bae\uff1b6\uff09\u8bbe\u8ba1\u89c4\u8303\u4e0e\u7ec4\u4ef6\u7ec4\u5408\u6280\u5de7\u3002\u901a\u8fc7\u7cfb\u7edf\u8bb2\u89e3Button\u7684\u5404\u7c7b\u7279\u6027\u548c\u4f7f\u7528\u573a\u666f\uff0c\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u5168\u9762\u7684\u5f00\u53d1\u6307\u5bfc\uff0c\u5e2e\u52a9\u6784\u5efa\u7f8e\u89c2\u3001\u9ad8\u6548\u7684\u4ea4\u4e92\u754c\u9762\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5125,5126,280,67],"topic":[],"class_list":["post-51691","post","type-post","status-publish","format-standard","hentry","category-server","tag-5125","tag-button","tag-harmonyos","tag-67"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u9e3f\u8499ArkUI\u4e2d\u7684Button\u7ec4\u4ef6\u5168\u9762\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528 - \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\/51691.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u9e3f\u8499ArkUI\u4e2d\u7684Button\u7ec4\u4ef6\u5168\u9762\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u9e3f\u8499ArkUI\u6846\u67b6\u4e2dButton\u7ec4\u4ef6\u7684\u5f00\u53d1\u4e0e\u5e94\u7528\u3002\u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a1\uff09Button\u7684\u4e09\u79cd\u521b\u5efa\u65b9\u5f0f\u53ca\u6838\u5fc3\u5c5e\u6027\u914d\u7f6e\uff1b2\uff09\u6837\u5f0f\u5b9a\u5236\u65b9\u6cd5\uff0c\u5305\u62ec\u9884\u5b9a\u4e49\u6837\u5f0f\u548c\u81ea\u5b9a\u4e49\u6837\u5f0f\uff1b3\uff09\u4ea4\u4e92\u529f\u80fd\u5b9e\u73b0\uff0c\u5982\u70b9\u51fb\u4e8b\u4ef6\u5904\u7406\u548c\u72b6\u6001\u7ba1\u7406\uff1b4\uff09\u9ad8\u7ea7\u7528\u6cd5\uff0c\u5982\u81ea\u5b9a\u4e49\u5185\u5bb9\u3001\u6309\u94ae\u7ec4\u548c\u52a8\u6001\u6548\u679c\uff1b5\uff09\u5e38\u89c1\u95ee\u9898\u89e3\u51b3\u65b9\u6848\u548c\u6027\u80fd\u4f18\u5316\u5efa\u8bae\uff1b6\uff09\u8bbe\u8ba1\u89c4\u8303\u4e0e\u7ec4\u4ef6\u7ec4\u5408\u6280\u5de7\u3002\u901a\u8fc7\u7cfb\u7edf\u8bb2\u89e3Button\u7684\u5404\u7c7b\u7279\u6027\u548c\u4f7f\u7528\u573a\u666f\uff0c\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u5168\u9762\u7684\u5f00\u53d1\u6307\u5bfc\uff0c\u5e2e\u52a9\u6784\u5efa\u7f8e\u89c2\u3001\u9ad8\u6548\u7684\u4ea4\u4e92\u754c\u9762\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/51691.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-10T19:39:09+00:00\" \/>\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=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/51691.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/51691.html\",\"name\":\"\u9e3f\u8499ArkUI\u4e2d\u7684Button\u7ec4\u4ef6\u5168\u9762\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-10T19:39:09+00:00\",\"dateModified\":\"2025-08-10T19:39:09+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/51691.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/51691.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/51691.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u9e3f\u8499ArkUI\u4e2d\u7684Button\u7ec4\u4ef6\u5168\u9762\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528\"}]},{\"@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":"\u9e3f\u8499ArkUI\u4e2d\u7684Button\u7ec4\u4ef6\u5168\u9762\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528 - \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\/51691.html","og_locale":"zh_CN","og_type":"article","og_title":"\u9e3f\u8499ArkUI\u4e2d\u7684Button\u7ec4\u4ef6\u5168\u9762\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u9e3f\u8499ArkUI\u6846\u67b6\u4e2dButton\u7ec4\u4ef6\u7684\u5f00\u53d1\u4e0e\u5e94\u7528\u3002\u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a1\uff09Button\u7684\u4e09\u79cd\u521b\u5efa\u65b9\u5f0f\u53ca\u6838\u5fc3\u5c5e\u6027\u914d\u7f6e\uff1b2\uff09\u6837\u5f0f\u5b9a\u5236\u65b9\u6cd5\uff0c\u5305\u62ec\u9884\u5b9a\u4e49\u6837\u5f0f\u548c\u81ea\u5b9a\u4e49\u6837\u5f0f\uff1b3\uff09\u4ea4\u4e92\u529f\u80fd\u5b9e\u73b0\uff0c\u5982\u70b9\u51fb\u4e8b\u4ef6\u5904\u7406\u548c\u72b6\u6001\u7ba1\u7406\uff1b4\uff09\u9ad8\u7ea7\u7528\u6cd5\uff0c\u5982\u81ea\u5b9a\u4e49\u5185\u5bb9\u3001\u6309\u94ae\u7ec4\u548c\u52a8\u6001\u6548\u679c\uff1b5\uff09\u5e38\u89c1\u95ee\u9898\u89e3\u51b3\u65b9\u6848\u548c\u6027\u80fd\u4f18\u5316\u5efa\u8bae\uff1b6\uff09\u8bbe\u8ba1\u89c4\u8303\u4e0e\u7ec4\u4ef6\u7ec4\u5408\u6280\u5de7\u3002\u901a\u8fc7\u7cfb\u7edf\u8bb2\u89e3Button\u7684\u5404\u7c7b\u7279\u6027\u548c\u4f7f\u7528\u573a\u666f\uff0c\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u5168\u9762\u7684\u5f00\u53d1\u6307\u5bfc\uff0c\u5e2e\u52a9\u6784\u5efa\u7f8e\u89c2\u3001\u9ad8\u6548\u7684\u4ea4\u4e92\u754c\u9762\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/51691.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-10T19:39:09+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/51691.html","url":"https:\/\/www.wsisp.com\/helps\/51691.html","name":"\u9e3f\u8499ArkUI\u4e2d\u7684Button\u7ec4\u4ef6\u5168\u9762\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-10T19:39:09+00:00","dateModified":"2025-08-10T19:39:09+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/51691.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/51691.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/51691.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u9e3f\u8499ArkUI\u4e2d\u7684Button\u7ec4\u4ef6\u5168\u9762\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528"}]},{"@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\/51691","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=51691"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/51691\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=51691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=51691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=51691"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=51691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}