{"id":480,"date":"2015-04-20T19:40:07","date_gmt":"2015-04-20T11:40:07","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=480"},"modified":"2026-08-18T12:58:40","modified_gmt":"2026-08-18T04:58:40","slug":"android%e5%b1%8f%e5%b9%95%e9%80%82%e9%85%8d","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=480","title":{"rendered":"Android\u5c4f\u5e55\u9002\u914d"},"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;\">\u56fe\u7247\u663e\u793a\u5148\u8981\u5206\u6e05\u50cf\u7d20\u3001\u5206\u8fa8\u7387\u548c\u5bc6\u5ea6\u3002\u4e00\u5f20\u56fe\u7531\u8bb8\u591a\u4e0d\u540c\u989c\u8272\u7684\u5c0f\u65b9\u683c\u7ec4\u6210\uff0c\u8fd9\u6837\u7684\u5c0f\u65b9\u683c\u5c31\u53eb\u50cf\u7d20\uff0c\u662f\u6784\u6210\u56fe\u7247\u7684\u6700\u5c0f\u5355\u4f4d\u3002\u50cf\u7d20\u7684\u7269\u7406\u5927\u5c0f\u53d6\u51b3\u4e8e\u663e\u793a\u8bbe\u5907\u4e0a\u4e00\u4e2a\u50cf\u7d20\u70b9\u7684\u8367\u5149\u70b9\u5927\u5c0f\uff1b\u56fe\u7247\u6587\u4ef6\u53ea\u8bb0\u5f55\u81ea\u5df1\u6709\u591a\u5c11\u50cf\u7d20\u3001\u6bcf\u4e2a\u50cf\u7d20\u4ec0\u4e48\u989c\u8272\uff0c\u5e76\u4e0d\u77e5\u9053\u81ea\u5df1\u7269\u7406\u5c3a\u5bf8\u6709\u591a\u5927\u3002\u4f8b\u5982\u4e00\u5f20 480&#215;800 \u7684\u56fe\u5728\u7535\u8111\u663e\u793a\u5668\u4e0a\u660e\u663e\u6bd4\u5728\u624b\u673a\u4e0a\u5927\uff0c\u56fe\u672c\u8eab\u6ca1\u53d8\uff0c\u53ea\u662f\u624b\u673a\u5c4f\u66f4\u7cbe\u7ec6\u3001\u6bcf\u4e2a\u7269\u7406\u50cf\u7d20\u66f4\u5c0f\u3001\u5bc6\u5ea6\u66f4\u5927\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\u3001\u50cf\u7d20\u3001\u5206\u8fa8\u7387\u3001\u5bc6\u5ea6<\/span><\/h2>\n<p style=\"margin: 1em 0px;\"><strong>\u5206\u8fa8\u7387<\/strong>\u5206\u300c\u56fe\u7247\u5206\u8fa8\u7387\u300d\u4e0e\u300c\u7269\u7406\u663e\u793a\u5206\u8fa8\u7387\u300d\u3002\u5b83\u4eec\u90fd\u662f\u6c34\u5e73\u50cf\u7d20\u70b9\u6570\u4e0e\u5782\u76f4\u50cf\u7d20\u70b9\u6570\u7684\u4e58\u79ef\uff0c\u4e5f\u5c31\u662f\u50cf\u7d20\u603b\u6570\u3002\u56fe\u7247\u5206\u8fa8\u7387\u662f\u6587\u4ef6\u8bb0\u5f55\u7684\u81ea\u8eab\u50cf\u7d20\u6570\uff1b\u7269\u7406\u663e\u793a\u5206\u8fa8\u7387\u662f\u5c4f\u6c34\u5e73\u4e0e\u5782\u76f4\u80fd\u663e\u793a\u7684\u50cf\u7d20\u6570\u4e58\u79ef\u3002\u6709\u4eba\u8bf4\u5206\u8fa8\u7387\u8d8a\u9ad8\u56fe\u8d8a\u6e05\u6670\uff0c\u8fd9\u53ea\u9488\u5bf9\u7269\u7406\u5c3a\u5bf8\u76f8\u540c\u7684\u60c5\u51b5\u2014\u2014\u4e00\u6837\u7684\u5206\u8fa8\u7387\u5c3a\u5bf8\u53ef\u80fd\u4e0d\u540c\uff0c\u5355\u6bd4\u5206\u8fa8\u7387\u6ca1\u6709\u53ef\u6bd4\u6027\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><strong>\u5bc6\u5ea6<\/strong>\u5c31\u662f\u7269\u7406\u8bbe\u5907\u4e0a\u5355\u4f4d\u5c3a\u5bf8\u91cc\u7684\u50cf\u7d20\u6570\uff0c\u5bc6\u5ea6\u8d8a\u5927\u56fe\u7247\u663e\u793a\u5c31\u8d8a\u6e05\u6670\u3002<\/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;\">\u4e8c\u3001Android \u7684\u957f\u5ea6\u5355\u4f4d<\/span><\/h2>\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n<li>\n<section><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">px<\/code>\uff1a\u50cf\u7d20\uff0c\u7ec8\u7aef\u4e0a\u7684\u4e00\u4e2a\u7269\u7406\u50cf\u7d20\u70b9\u3002\u4f8b\u5982 480&#215;800 \u7684\u5c4f\u6a2a\u5411 480 \u4e2a\u50cf\u7d20\u3001\u7eb5\u5411 800 \u4e2a\u50cf\u7d20\u3002<\/section>\n<\/li>\n<li>\n<section><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">dip<\/code> \/ <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">dp<\/code>\uff1a\u4e0e\u7269\u7406\u50cf\u7d20\u65e0\u5173\uff0c\u57fa\u4e8e\u5c4f\u5e55\u5bc6\u5ea6\u7684\u62bd\u8c61\u5355\u4f4d\uff0c\u79f0\u4f5c\u8bbe\u5907\u72ec\u7acb\u50cf\u7d20\uff0c\u4f1a\u968f\u5bc6\u5ea6\u81ea\u52a8\u8c03\u6574\u5927\u5c0f\u3002<\/section>\n<\/li>\n<li>\n<section><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">sp<\/code>\uff1a\u6bd4\u4f8b\u50cf\u7d20\uff0c\u4e3b\u8981\u5904\u7406\u5b57\u4f53\u5927\u5c0f\uff0c\u53ef\u6839\u636e\u7528\u6237\u7684\u5b57\u4f53\u5927\u5c0f\u9996\u9009\u9879\u7f29\u653e\u3002<\/section>\n<\/li>\n<li>\n<section><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">in<\/code>\uff1a\u82f1\u5bf8\uff0c\u6807\u51c6\u957f\u5ea6\u5355\u4f4d\u3002<\/section>\n<\/li>\n<li>\n<section><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">mm<\/code>\uff1a\u6beb\u7c73\uff0c\u6807\u51c6\u957f\u5ea6\u5355\u4f4d\u3002<\/section>\n<\/li>\n<li>\n<section><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">pt<\/code>\uff1a\u78c5\uff0c\u6807\u51c6\u957f\u5ea6\u5355\u4f4d\uff0c1\/72 \u82f1\u5bf8\u3002<\/section>\n<\/li>\n<\/ul>\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;\">\u4e09\u3001\u4e3a\u4ec0\u4e48\u8981\u505a\u5c4f\u5e55\u9002\u914d<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">Android \u7ec8\u7aef\u7684\u7269\u7406\u5c3a\u5bf8\u3001\u5206\u8fa8\u7387\u7c7b\u522b\u4f17\u591a\u3002\u53ef\u80fd\u4f60\u4e3a\u4e00\u79cd\u7ec8\u7aef\u8bbe\u8ba1\u7684 UI \u7b26\u5408\u8981\u6c42\uff0c\u5728\u53e6\u4e00\u7c7b\u5927\u5c0f\u7684\u7269\u7406\u7ec8\u7aef\u4e0a\u663e\u793a\u5c31\u5b8c\u5168\u4e0d\u662f\u4f60\u60f3\u8981\u7684\u3002<\/p>\n<p style=\"margin: 1em 0px;\">Android \u63d0\u4f9b\u4e86\u4e00\u5957\u6807\u51c6\uff0c\u628a\u5c4f\u5e55\u5206\u6210\u4e09\u7c7b\u3002\u65b0\u5efa\u5de5\u7a0b\u540e\u4f1a\u81ea\u52a8\u521b\u5efa\u4e09\u4e2a\u5b58\u653e\u4e0d\u540c\u5206\u8fa8\u7387\u3001\u4e0d\u540c\u5bc6\u5ea6 UI \u7684\u6587\u4ef6\u5939\uff1a<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235101475.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" title=\"drawable\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235114997.png\" alt=\"drawable\" width=\"148\" height=\"61\" border=\"0\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u4e09\u4e2a\u6587\u4ef6\u5939\u4e0b\u7684 UI \u5bf9\u5e94\u4e0d\u540c\u5206\u8fa8\u7387\u53ca\u5bc6\u5ea6\uff1a<\/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;\">\u8d44\u6e90\u76ee\u5f55<\/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;\">\u5c4f\u5e55\u7c7b\u578b<\/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;\">\u5206\u8fa8\u7387<\/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;\">\u5bc6\u5ea6<\/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;\">\u5c3a\u5bf8<\/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;\">drawable-hdpi<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">WVGA<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">480&#215;800<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">240<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u5927<\/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;\">drawable-mdpi<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">HVGA<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">320&#215;480<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">160<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u4e2d<\/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;\">drawable-ldpi<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">QVGA<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">240&#215;320<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">120<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u5c0f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin: 1em 0px;\">\u8fd9\u4e09\u4e2a\u6587\u4ef6\u5939\u53ea\u662f\u544a\u8bc9 Android\uff1a\u4f60\u8bbe\u8ba1\u7684 UI \u662f\u9488\u5bf9\u54ea\u79cd\u5c4f\u5e55\u5206\u8fa8\u7387\u53ca\u5bc6\u5ea6\u3002\u6253\u5f00\u5e94\u7528\u65f6\uff0c\u7ec8\u7aef\u4f1a\u81ea\u52a8\u5339\u914d\u4e0e\u6587\u4ef6\u5939\u91cc\u63d0\u4f9b\u7684 UI \u76f8\u8fd1\u5206\u8fa8\u7387\u53ca\u5bc6\u5ea6\u7684\u56fe\u7247\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u5047\u8bbe\u7ec8\u7aef\u662f WVGA\uff08\u5bc6\u5ea6 240\uff09\uff0c\u7a0b\u5e8f\u4f1a\u53bb\u62bd drawable-hdpi \u4e0b\u7684\u56fe\uff0c\u7136\u540e\u7528\u4e00\u4e2a\u7269\u7406\u50cf\u7d20\u663e\u793a\u4e00\u4e2a\u56fe\u7247\u50cf\u7d20\u2014\u2014\u56e0\u4e3a\u4f60\u628a\u56fe\u653e\u5728 hdpi\uff0c\u5c31\u662f\u544a\u8bc9\u7cfb\u7edf UI \u9488\u5bf9 480&#215;800\u3001\u5bc6\u5ea6 240\uff0c\u4e8e\u662f\u4e0d\u4f1a\u653e\u5927\u6216\u7f29\u5c0f\u3002\u5f53\u56fe\u7247\u5bc6\u5ea6\u4e0e\u5c4f\u5e55\u5bc6\u5ea6\u76f8\u540c\u5219\u4e0d\u7f29\u653e\uff1b\u4e0d\u540c\u5219\u7f29\u653e\u3002<\/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;\">\u56db\u3001\u5b9e\u9a8c 1\uff1a\u53ea\u653e\u4e00\u5f20 hdpi \u56fe<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u9488\u5bf9 480&#215;800 \u7684\u5c4f\u8bbe\u8ba1\u4e00\u5f20\u56fe\uff08\u5206\u8fa8\u7387 480&#215;100\uff09\uff0c\u5206\u522b\u5728\u4e0d\u540c\u7269\u7406\u5206\u8fa8\u7387\u7ec8\u7aef\u4e0b\u663e\u793a\uff0c\u770b\u4f1a\u4e0d\u4f1a\u4e0d\u6b63\u5e38\u3002\u539f\u56fe\uff1a<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235115488.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" title=\"density\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235121244.png\" alt=\"density\" width=\"480\" height=\"100\" border=\"0\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u5e03\u5c40\u6587\u4ef6\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n\n&lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\n\n    android:orientation=&quot;vertical&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;fill_parent&quot;\n\n    android:gravity=&quot;center&quot;\n\n    &gt;\n\n    &lt;ImageView\n\n        android:layout_width=&quot;wrap_content&quot;\n\n        android:layout_height=&quot;wrap_content&quot;\n\n        android:src=&quot;@drawable\/density480800&quot;\/&gt;\n\n&lt;\/LinearLayout&gt;<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u5047\u8bbe\u8fd9\u5f20\u56fe\u5bbd 480\u3001\u9ad8 100\uff0c\u653e\u5728 drawable-hdpi\uff0c\u5c31\u662f\u544a\u8bc9 Android \u8bbe\u8ba1\u610f\u56fe\u9488\u5bf9 480&#215;800\u3002\u5b83\u4f1a\u5728 480&#215;800 \u7ec8\u7aef\u4e0a\u4ee5\u4e00\u4e2a\u7269\u7406\u50cf\u7d20\u663e\u793a\u4e00\u4e2a\u56fe\u7247\u50cf\u7d20\u3002\u82e5\u62ff\u5230 240&#215;320 \u7ec8\u7aef\u4e0a\uff0c\u5982\u679c\u7cfb\u7edf\u4e0d\u5904\u7406\u3001\u4ecd\u4e00\u5bf9\u4e00\u663e\u793a\uff0c\u7ec8\u7aef\u5fc5\u7136\u663e\u793a\u4e0d\u4e0b\uff0c\u56e0\u4e3a\u56fe\u7247\u50cf\u7d20\u8d85\u8fc7\u4e86\u7269\u7406\u50cf\u7d20\u4e2a\u6570\u3002\u6ce8\u610f\uff1a\u8fd9\u91cc\u53ea\u8bbe\u8ba1\u4e86\u4e00\u5f20\u56fe\u5e76\u53ea\u653e\u5728 hdpi\uff0c\u5339\u914d\u65f6\u4e5f\u5c31\u53ea\u80fd\u5339\u914d\u8fd9\u5f20\u56fe\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u7ed3\u679c\uff1a<\/p>\n<p style=\"margin: 1em 0px;\"><strong>WVGA<\/strong>\uff1a\u5bf9\u6bd4\u539f\u56fe\uff0c\u6b63\u597d\u663e\u793a\u4e0b\uff0c\u5927\u5c0f\u76f8\u540c\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235136162.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" title=\"image\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235141112.png\" alt=\"image\" width=\"501\" height=\"159\" border=\"0\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\"><strong>HVGA<\/strong>\uff1a\u5bf9\u6bd4\u539f\u56fe\uff0c\u80fd\u591f\u663e\u793a\u4e0b\uff0c\u5bf9\u56fe\u7247\u8fdb\u884c\u4e86\u7f29\u5c0f\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235158189.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" title=\"image\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235154535.png\" alt=\"image\" width=\"356\" height=\"110\" border=\"0\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\"><strong>QVGA<\/strong>\uff1a\u5bf9\u6bd4\u539f\u56fe\uff0c\u80fd\u591f\u663e\u793a\u4e0b\uff0c\u5bf9\u56fe\u7247\u8fdb\u884c\u4e86\u7f29\u5c0f\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235166421.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" title=\"image\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235163912.png\" alt=\"image\" width=\"269\" height=\"77\" border=\"0\" \/><\/a><\/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;\">\u4e94\u3001\u5b9e\u9a8c 2\uff1a\u53ea\u653e\u4e00\u5f20 ldpi \u56fe<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u9488\u5bf9 240&#215;320 \u7684\u5c4f\u8bbe\u8ba1\u4e00\u5f20\u56fe\uff08\u5206\u8fa8\u7387 240&#215;100\uff09\uff0c\u5206\u522b\u5728\u4e0d\u540c\u7ec8\u7aef\u663e\u793a\u3002\u539f\u56fe\uff1a<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235173846.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" title=\"density-240-320\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235171272.png\" alt=\"density-240-320\" width=\"240\" height=\"100\" border=\"0\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u5e03\u5c40\u6587\u4ef6\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n\n&lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;\n\n    android:orientation=&quot;vertical&quot;\n\n    android:layout_width=&quot;fill_parent&quot;\n\n    android:layout_height=&quot;fill_parent&quot;\n\n    android:gravity=&quot;center&quot;\n\n    &gt;\n\n    &lt;ImageView\n\n        android:layout_width=&quot;wrap_content&quot;\n\n        android:layout_height=&quot;wrap_content&quot;\n\n        android:src=&quot;@drawable\/density240320&quot;\/&gt;\n\n&lt;\/LinearLayout&gt;<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u8fd9\u5f20\u56fe\u4e13\u95e8\u4e3a 240&#215;320 \u8bbe\u8ba1\uff0c\u610f\u56fe\u662f\u6491\u6ee1\u5c4f\u5e55\u5bbd\u5ea6\uff0c\u6240\u4ee5 wrap_content \u5c31\u591f\uff0c\u6ca1\u6709\u8003\u8651\u5176\u5b83\u5c4f\u3002\u653e\u5728 drawable-ldpi\uff0c\u544a\u8bc9\u7cfb\u7edf\u9488\u5bf9 240&#215;320\u3001\u5bc6\u5ea6 120\u3002\u5728 240&#215;320 \u4e0a\u4f1a\u4e00\u5bf9\u4e00\u663e\u793a\uff1b\u82e5\u62ff\u5230 480&#215;800 \u4e0a\u7cfb\u7edf\u4e0d\u5904\u7406\uff0c\u56fe\u7247\u50cf\u7d20\u5c0f\u4e8e\u7269\u7406\u50cf\u7d20\uff0c\u5c31\u4f1a\u504f\u79bb\u300c\u5145\u6ee1\u5c4f\u5bbd\u300d\u7684\u8bbe\u8ba1\u610f\u56fe\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><strong>QVGA<\/strong>\uff1a\u5bf9\u6bd4\u539f\u56fe\uff0c\u6b63\u597d\u6491\u6ee1\u5c4f\u5bbd\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235183158.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" title=\"image\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/20120325223518617.png\" alt=\"image\" width=\"264\" height=\"127\" border=\"0\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\"><strong>HVGA<\/strong>\uff1a\u867d\u7136\u8bbe\u7f6e\u6210 wrap_content\uff0cAndroid \u8fd8\u662f\u8fdb\u884c\u4e86\u653e\u5927\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235199122.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" title=\"image\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235201564.png\" alt=\"image\" width=\"341\" height=\"156\" border=\"0\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\"><strong>WVGA<\/strong>\uff1a\u540c\u4e0a\uff0c\u4e5f\u4f1a\u653e\u5927\u3002<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235218368.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" title=\"image\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235249740.png\" alt=\"image\" width=\"491\" height=\"218\" border=\"0\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u603b\u7ed3\uff1a<\/p>\n<ul style=\"padding-left: 1rem; margin-left: 1rem; font-size: 0.9rem; list-style-type: disc;\">\n<li>\n<section>\u53ea\u8981\u5bf9\u4e00\u79cd\u5c4f\u5e55\u8bbe\u8ba1\u4e00\u5957 UI\uff0cAndroid \u603b\u80fd\u901a\u8fc7\u653e\u5927\u6216\u7f29\u5c0f\u6765\u9002\u5e94\u5c4f\u5e55\u3001\u4fdd\u8bc1\u8bbe\u8ba1\u610f\u56fe\uff0c\u524d\u63d0\u662f\u5e03\u5c40\u91cc\u7684\u5355\u4f4d\u662f dip\u3002<\/section>\n<\/li>\n<li>\n<section>\u867d\u7136\u7cfb\u7edf\u80fd\u4fdd\u8bc1\u8bbe\u8ba1\u610f\u56fe\uff0c\u5b9e\u9645\u5de5\u4f5c\u4e2d\u6700\u597d\u8fd8\u662f\u591a\u8bbe\u8ba1\u51e0\u5957 UI\u3002\u5b9e\u9a8c 2 \u91cc\u653e\u5927\u540e\u7684\u56fe\u660e\u663e\u6a21\u7cca\u4e86\u8bb8\u591a\u3002<\/section>\n<\/li>\n<li>\n<section>\u5982\u679c\u53ea\u60f3\u8bbe\u8ba1\u4e00\u5957 UI\uff0c\u6700\u597d\u9488\u5bf9\u5927\u5206\u8fa8\u7387\u7ec8\u7aef\u6765\u8bbe\u8ba1\uff1a\u7f29\u5c0f\u6bd4\u653e\u5927\u7684\u6e05\u6670\u5ea6\u66f4\u597d\u3002<\/section>\n<\/li>\n<\/ul>\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;\">\u516d\u3001\u5b9e\u9a8c 3\uff1a\u4ece\u6587\u4ef6\u8def\u5f84\u8bfb\u56fe<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u4e0a\u9762\u7684\u56fe\u90fd\u4ece drawable \u83b7\u53d6\uff0c\u6240\u4ee5 Android \u77e5\u9053\u6309\u4ec0\u4e48\u5bc6\u5ea6\u5904\u7406\uff08\u653e\u5927\u6216\u7f29\u5c0f\uff09\u3002\u5982\u679c\u56fe\u662f\u4ece data\/data \u6216 SD \u5361\u83b7\u53d6\uff0c\u7cfb\u7edf\u4f1a\u9ed8\u8ba4\u628a\u56fe\u7247\u5f53\u4f5c 160 \u7684\u57fa\u51c6\u5bc6\u5ea6\u6765\u5904\u7406\u3002\u628a\u5b9e\u9a8c\u4e8c\u7684\u56fe\u653e\u5165 data\/data\/cn.com\/ \u5e76\u8bbe\u5230 ImageView \u4e0a\uff0c\u672c\u610f\u662f\u5145\u6ee1\u7ec8\u7aef\u5bbd\u5ea6\uff0c\u7ed3\u679c\u5982\u4f55\uff1f<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">public class Test4Activity extends Activity {\n\n    private ImageView iv;\n\n    @Override\n\n    public void onCreate(Bundle savedInstanceState) {\n\n        super.onCreate(savedInstanceState);\n\n        setContentView(R.layout.main);\n\n        iv = (ImageView)findViewById(R.id.image);\n\n        iv.setImageDrawable(new BitmapDrawable(BitmapFactory.decodeFile(&quot;data\/data\/cn.com\/density-240-320.png&quot;)));\n\n}<\/code><\/pre>\n<p style=\"margin: 1em 0px;\"><strong>HVGA \u5c4f\u4e0b\uff1a<\/strong><\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235244723.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" title=\"image\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/201203252235246609.png\" alt=\"image\" width=\"349\" height=\"130\" border=\"0\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u56fe\u7247\u5e76\u6ca1\u6709\u5982\u613f\u5145\u6ee1\u5c4f\u5bbd\u3002\u539f\u56e0\u662f Android \u628a\u56fe\u7247\u5bc6\u5ea6\u5f53\u4f5c 160 \u57fa\u51c6\u5bc6\u5ea6\uff0c\u800c HVGA \u7ec8\u7aef\u5bc6\u5ea6\u6b63\u597d\u662f 160\uff0c\u5bc6\u5ea6\u76f8\u540c\u4e0d\u4f1a\u7f29\u653e\uff0c\u4e8e\u662f\u4e00\u5bf9\u4e00\u663e\u793a\uff1a\u5bbd 240 \u50cf\u7d20\u7684\u56fe\u5f53\u7136\u65e0\u6cd5\u5145\u6ee1\u5bbd 320 \u50cf\u7d20\u7684\u5c4f\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u5e0c\u671b\u4ece\u975e drawable \u76ee\u5f55\u83b7\u53d6\u7684\u56fe\u7247\u4e5f\u80fd\u667a\u80fd\u7f29\u653e\uff0c\u5c31\u8981\u544a\u8bc9 Android \u8fd9\u5f20\u56fe\u6309\u4ec0\u4e48\u5bc6\u5ea6\u5904\u7406\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">public class Test4Activity extends Activity {\n\n    private ImageView iv;\n\n    @Override\n\n    public void onCreate(Bundle savedInstanceState) {\n\n        super.onCreate(savedInstanceState);\n\n        setContentView(R.layout.main);\n\n        iv = (ImageView)findViewById(R.id.image);\n\n        BitmapFactory.Options options = new BitmapFactory.Options();\n\n    \/\/\u8bbe\u7f6e\u5de5\u5382\u4ee5120\u7684\u5bc6\u5ea6\u6765\u8bfb\u53d6\u56fe\u7247\u6587\u4ef6\n\n         options.inDensity = 120;\n\n        BitmapDrawable image = new BitmapDrawable(BitmapFactory.decodeFile(&quot;data\/data\/cn.com\/density-240-320.png&quot;,options));\n\n        \/\/\u8bbe\u7f6e\u56fe\u7247\u5728\u7ec8\u7aef\u4e2d\u4ee5\u7ec8\u7aef\u672c\u8eab\u7684\u5bc6\u5ea6\u6765\u663e\u793a\u56fe\u7247\n\n         image.setTargetDensity(getApplicationContext().getResources().getDisplayMetrics());\n\n        iv.setImageDrawable(image);\n\n}<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u6700\u7ec8\u6548\u679c\uff0cHVGA \u5c4f\u4e0b\uff1a<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/20120325223527805.png\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" title=\"image\" src=\"http:\/\/images.cnblogs.com\/cnblogs_com\/wujd\/201203\/20120325223528149.png\" alt=\"image\" width=\"340\" height=\"154\" border=\"0\" \/><\/a><\/p>\n<p style=\"margin: 1em 0px;\">\u7ed3\u675f\uff1aAndroid \u4e2d\u957f\u5ea6\u5355\u4f4d\u6700\u597d\u4f7f\u7528\u4e0e\u7269\u7406\u50cf\u7d20\u65e0\u5173\u7684\u903b\u8f91\u50cf\u7d20 dip\uff0c\u8fd9\u6837\u7cfb\u7edf\u5c31\u80fd\u81ea\u52a8\u9002\u5e94\u4e0d\u540c\u5c4f\u5e55\u3001\u4fdd\u6301\u8bbe\u8ba1\u610f\u56fe\u3002\u56fe\u7247\u5927\u5c0f\u7684\u8f6c\u6362\u662f\u57fa\u4e8e\u5bc6\u5ea6\uff0c\u4e0e\u5c4f\u5e55\u5206\u8fa8\u7387\u548c\u5c3a\u5bf8\u5927\u5c0f\u65e0\u5173\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\u5e03\u5c40\u7528 dp\/dip\uff0c\u56fe\u7247\u6309 hdpi\/mdpi\/ldpi \u5206\u6876\uff1b\u4ece\u6587\u4ef6\u8bfb\u56fe\u65f6\u8981\u81ea\u5df1\u8bbe inDensity \u548c targetDensity\uff0c\u7cfb\u7edf\u624d\u4f1a\u6309\u5bc6\u5ea6\u7f29\u653e\u3002<\/strong><\/p>\n<\/blockquote>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u56fe\u7247\u663e\u793a\u5148\u8981\u5206\u6e05\u50cf\u7d20\u3001\u5206\u8fa8\u7387\u548c\u5bc6\u5ea6\u3002\u4e00\u5f20\u56fe\u7531\u8bb8\u591a\u4e0d\u540c\u989c\u8272\u7684\u5c0f\u65b9\u683c\u7ec4\u6210\uff0c\u8fd9\u6837\u7684\u5c0f\u65b9\u683c\u5c31\u53eb\u50cf\u7d20\uff0c\u662f\u6784\u6210\u56fe\u7247\u7684\u6700\u5c0f\u5355 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[54],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/480"}],"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=480"}],"version-history":[{"count":3,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/480\/revisions"}],"predecessor-version":[{"id":483,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/480\/revisions\/483"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}