{"id":442,"date":"2015-04-19T19:37:16","date_gmt":"2015-04-19T11:37:16","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=442"},"modified":"2026-08-18T12:58:39","modified_gmt":"2026-08-18T04:58:39","slug":"android%e7%9a%84%e5%9b%be%e5%bd%a2%e7%94%a8%e6%88%b7%e7%95%8c%e9%9d%a2","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=442","title":{"rendered":"Android\u7684\u56fe\u5f62\u7528\u6237\u754c\u9762"},"content":{"rendered":"<section id=\"wenyan\" style=\"font-family: system-ui, 'Apple Color Emoji', 'Segoe UI', 'Segoe UI Symbol', 'Noto Sans', Roboto, sans-serif; line-height: 1.75; font-size: 16px; color: #000000; caret-color: #000000;\" data-provider=\"WenYan\">\n<blockquote style=\"margin: 20px 0px; display: block; font-size: 0.9em; overflow: auto; border-left: 3px solid #ef7060; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"margin: 1em 0px;\">Android \u7684\u56fe\u5f62\u7528\u6237\u754c\u9762\u7531\u591a\u4e2a <strong>View<\/strong> \u548c <strong>ViewGroup<\/strong> \u642d\u8d77\u6765\u3002View \u662f\u901a\u7528\u7684 UI \u5c0f\u7ec4\u4ef6\uff0c\u6bd4\u5982\u6309\u94ae\uff08Button\uff09\u6216\u6587\u672c\u6846\uff08text field\uff09\uff1bViewGroup \u662f\u4e0d\u53ef\u89c1\u7684\u5bb9\u5668\uff0c\u7528\u6765\u5b9a\u4e49\u5b50 View \u7684\u6446\u653e\u65b9\u5f0f\uff0c\u6bd4\u5982\u7f51\u683c\uff08grid\uff09\u548c\u5782\u76f4\u5217\u8868\uff08list\uff09\u3002<\/p>\n<\/blockquote>\n<p><!--more--><\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e00\u3001View \u4e0e ViewGroup<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u754c\u9762\u4e0d\u662f\u4e00\u5757\u753b\u5e03\u968f\u4fbf\u6d82\uff0c\u800c\u662f\u4e00\u68f5\u6811\uff1a\u53f6\u5b50\u8282\u70b9\u591a\u534a\u662f\u5177\u4f53\u63a7\u4ef6\uff08View\uff09\uff0c\u679d\u5e72\u662f\u5e03\u5c40\u5bb9\u5668\uff08ViewGroup\uff09\u3002\u5bb9\u5668\u51b3\u5b9a\u5b69\u5b50\u600e\u4e48\u6392\uff0c\u5b69\u5b50\u8d1f\u8d23\u663e\u793a\u548c\u70b9\u51fb\u3002<\/p>\n<table style=\"border-collapse: collapse; margin: 1.4em auto; max-width: 100%; table-layout: fixed; text-align: left; overflow: auto; display: table; overflow-wrap: break-word; word-break: break-all;\" width=\"817\">\n<thead>\n<tr>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u89d2\u8272<\/th>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u53ef\u89c1\u5417<\/th>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u4f8b\u5b50<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">View<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u662f\uff0c\u7528\u6237\u80fd\u770b\u89c1\u3001\u80fd\u70b9<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">Button\u3001\u6587\u672c\u6846\uff08text field\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">ViewGroup<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u5bb9\u5668\u672c\u8eab\u901a\u5e38\u4e0d\u53ef\u89c1<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u7f51\u683c\uff08grid\uff09\u3001\u5782\u76f4\u5217\u8868\uff08list\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e8c\u3001\u7528 XML \u642d\u5c42\u7ea7\u754c\u9762<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">Android \u63d0\u4f9b\u4e86\u4e00\u5957\u5bf9\u5e94\u4e8e View \u548c ViewGroup \u5b50\u7c7b\u7684 XML \u6807\u7b7e\u8bcd\u6c47\u8868\u3002\u4f60\u53ef\u4ee5\u5728 XML \u91cc\u7528\u5c42\u7ea7\u89c6\u56fe\u5143\u7d20\u521b\u5efa\u81ea\u5df1\u7684 UI\u2014\u2014\u6807\u7b7e\u5957\u6807\u7b7e\uff0c\u5c31\u662f\u6811\u4e0a\u7684\u7236\u5b50\u5173\u7cfb\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/04\/12.jpeg\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-443\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/04\/12.jpeg\" alt=\"12\" width=\"474\" height=\"253\" srcset=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/04\/12.jpeg 474w, https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/04\/12-300x160.jpeg 300w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u4e0a\u56fe\u628a\u300c\u63a7\u4ef6\u300d\u548c\u300c\u5bb9\u5668\u300d\u5206\u6210\u4e24\u5c42\uff1a\u53f6\u5b50\u662f View\uff0c\u4e2d\u95f4\u8282\u70b9\u662f ViewGroup\u3002\u5199\u5e03\u5c40\u6587\u4ef6\u65f6\uff0c\u5916\u5c42\u51e0\u4e4e\u603b\u662f\u67d0\u4e2a ViewGroup\uff0c\u5185\u5c42\u518d\u653e Button\u3001TextView \u6216\u7ee7\u7eed\u5d4c\u5957\u5bb9\u5668\u3002<\/p>\n<blockquote style=\"margin: 20px 0px; display: block; font-size: 0.9em; overflow: auto; border-left: 3px solid #ef7060; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"margin: 1em 0px;\"><strong>\u4e00\u53e5\u8bdd\u603b\u7ed3\uff1a\u754c\u9762\u662f View \u6811\u2014\u2014View \u8d1f\u8d23\u663e\u793a\uff0cViewGroup \u8d1f\u8d23\u6392\u5e03\uff1bXML \u6807\u7b7e\u5c31\u662f\u8fd9\u68f5\u6811\u7684\u4e66\u9762\u5f62\u5f0f\u3002<\/strong><\/p>\n<\/blockquote>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>Android \u7684\u56fe\u5f62\u7528\u6237\u754c\u9762\u7531\u591a\u4e2a View \u548c ViewGroup \u642d\u8d77\u6765\u3002View \u662f\u901a\u7528\u7684 UI \u5c0f\u7ec4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[52],"tags":[195],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/442"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=442"}],"version-history":[{"count":1,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/442\/revisions"}],"predecessor-version":[{"id":444,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/442\/revisions\/444"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}