{"id":1877,"date":"2018-03-19T11:16:31","date_gmt":"2018-03-19T02:16:31","guid":{"rendered":"http:\/\/kuuur.net\/?p=1877"},"modified":"2018-03-19T11:16:31","modified_gmt":"2018-03-19T02:16:31","slug":"buttonshiyo","status":"publish","type":"post","link":"https:\/\/kuuur.net\/?p=1877","title":{"rendered":"Android\u30a2\u30d7\u30ea\uff1a\u30dc\u30bf\u30f3\u306e\u4ed5\u69d8\u30921\u3064\u306exml\u30d5\u30a1\u30a4\u30eb\u306b\u307e\u3068\u3081\u308b"},"content":{"rendered":"<p>Android Studio\u3067\u3001\u30dc\u30bf\u30f3\u306a\u3069\u306e\u8272\u3084\u5f62\u306e\u6307\u5b9a\u3092\u3059\u308b\u969b\u30011\u3064\u306exml\u30d5\u30a1\u30a4\u30eb\u3067\u3001\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u305f\u3068\u304d\u3068\u62bc\u3057\u3066\u3044\u306a\u3044\u3068\u304d\u306e\u72b6\u614b\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<h2>xml\u30d5\u30a1\u30a4\u30eb\u306e\u6307\u5b9a<\/h2>\n<p>Android Studio\u306e\u5de6\u306e\u30c4\u30ea\u30fc\u304b\u3089\u3001\u300cres\\drawable\u300d\u306e\u4e0a\u3067\u53f3\u30af\u30ea\u30c3\u30af\u2192\u300cNew\u300d\u2192\u300cDrawable resource file\u300d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\u300cFile name:\u300d\u306b\u300cbutton.xml\u300d\u3068\u5165\u529b\u3057\u3066\u300cOK\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u300cbutton.xml\u300d\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<div class=\"source\">\n<pre>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;selector xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"&gt;\r\n    &lt;item android:state_pressed=\"false\"&gt;\r\n        &lt;shape android:shape=\"rectangle\"&gt;\r\n            &lt;corners\r\n                android:radius=\"5dip\"\/&gt;\r\n            &lt;solid\r\n                android:color=\"#cccccc\"\/&gt;\r\n            &lt;padding\r\n                android:top=\"5dip\"\r\n                android:bottom=\"5dip\"\r\n                \/&gt;\r\n        &lt;\/shape&gt;\r\n    &lt;\/item&gt;\r\n    &lt;item android:state_pressed=\"true\"&gt;\r\n        &lt;shape android:shape=\"rectangle\"&gt;\r\n            &lt;corners\r\n                android:radius=\"5dip\"\/&gt;\r\n            &lt;solid\r\n                android:color=\"#aaaaaa\"\/&gt;\r\n            &lt;padding\r\n                android:top=\"5dip\"\r\n                android:bottom=\"5dip\"\r\n                \/&gt;\r\n        &lt;\/shape&gt;\r\n    &lt;\/item&gt;\r\n&lt;\/selector&gt;<\/pre>\n<\/div>\n<p>&lt;item android:state_pressed=&#8221;false&#8221;&gt;\u306f\u3001\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u3066\u3044\u306a\u3044\u72b6\u614b\u3001<br \/>\n&lt;item android:state_pressed=&#8221;true&#8221;&gt;\u306f\u3001\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u305f\u72b6\u614b\u3092\u6307\u3057\u307e\u3059\u3002<br \/>\n\u305d\u308c\u305e\u308c\u306eitem\u30bf\u30b0\u5185\u306b\u30dc\u30bf\u30f3\u306e\u72b6\u614b\u3092\u8a18\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>&lt;shape android:shape&gt;<\/h3>\n<p>shape\u306b\u306f4\u7a2e\u985e\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<table class=\"t2\">\n<tbody>\n<tr>\n<td>rectangle<\/td>\n<td>\u56db\u89d2\u5f62<\/td>\n<\/tr>\n<tr>\n<td>oval<\/td>\n<td>\u6955\u5186<\/td>\n<\/tr>\n<tr>\n<td>line<\/td>\n<td>\u76f4\u7dda<\/td>\n<\/tr>\n<tr>\n<td>ring<\/td>\n<td>\u5186\u5f62<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>ring\u306e\u5834\u5408\u306b\u9650\u308a\u3001\u4ee5\u4e0b\u306e\u5c5e\u6027\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<table class=\"t2\">\n<tbody>\n<tr>\n<td>android:innerRadius<\/td>\n<td>\u5185\u5074\u306e\u5186\uff08\u4e2d\u592e\u306e\u7a74\uff09\u306e\u534a\u5f84\u3092dp\u3067\u6307\u5b9a<\/td>\n<\/tr>\n<tr>\n<td>android:innerRadiusRatio<\/td>\n<td>\u5185\u5074\u306e\u5186\u534a\u5f84\u3092\u30ea\u30f3\u30b0\u306e\u5e45\u306e\u6bd4\u3067\u6307\u5b9a\u3002<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306f9\u3002<br \/>\n\u6d6e\u52d5\u5c0f\u6570\u3067\u6307\u5b9a\u3002<\/td>\n<\/tr>\n<tr>\n<td>android:thicknes<\/td>\n<td>\u30ea\u30f3\u30b0\u306e\u539a\u307f\u3092dp\u3067\u6307\u5b9a\u3002<\/td>\n<\/tr>\n<tr>\n<td>android:thicknessRatio<\/td>\n<td>\u30ea\u30f3\u30af\u306e\u539a\u307f\u3092\u30ea\u30f3\u30b0\u5e45\u306e\u6bd4\u3067\u6307\u5b9a\u3002<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306f3\u3002<br \/>\n\u6d6e\u52d5\u5c0f\u6570\u3067\u6307\u5b9a\u3002<\/td>\n<\/tr>\n<tr>\n<td>android:useLevel<\/td>\n<td>LevelListDrawable\u3068\u3057\u3066\u4f7f\u3046\u5834\u5408\u306ftrue<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>LevelListDrawable\u3068\u306f\u3001\u6574\u6570\u5024\u3067\u3042\u308bLevel\u3068\u753b\u50cf\u3092\u7d10\u3065\u3051\u3066\u3001\u8907\u6570\u306e\u753b\u50cf\u3092\u5207\u308a\u66ff\u3048\u3089\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n<h3>&lt;corners \/&gt;<\/h3>\n<p>4\u9685\u306e\u89d2\u4e38\u306e\u534a\u5f84\u3092\u6570\u5024\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n&lt;shape&gt;\uff5e&lt;\/shape&gt;\u5185\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<table class=\"t2\">\n<tbody>\n<tr>\n<td>android:radius<\/td>\n<td>4\u9685\u3092\u307e\u3068\u3081\u3066\u6307\u5b9a<\/td>\n<\/tr>\n<tr>\n<td>android:topLeftRadius<\/td>\n<td>\u5de6\u4e0a<\/td>\n<\/tr>\n<tr>\n<td>android:topRightRadius<\/td>\n<td>\u53f3\u4e0a<\/td>\n<\/tr>\n<tr>\n<td>android:bottomLeftRadius<\/td>\n<td>\u5de6\u4e0b<\/td>\n<\/tr>\n<tr>\n<td>android:bottomRightRadius<\/td>\n<td>\u53f3\u4e0b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>&lt;gradient \/&gt;<\/h3>\n<p>\u30dc\u30bf\u30f3\u306e\u80cc\u666f\u8272\u306b\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u304b\u3051\u307e\u3059\u3002<br \/>\n&lt;shape&gt;\uff5e&lt;\/shape&gt;\u5185\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<table class=\"t2\">\n<tbody>\n<tr>\n<td>android:angle<\/td>\n<td>\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3\u306e\u65b9\u5411\u30920\uff5e360\u3067\u6307\u5b9a\u3002<br \/>\n0\u306f\u5de6\u304b\u3089\u53f3\u3001<br \/>\n90\u306f\u4e0b\u304b\u3089\u4e0a\u3001<br \/>\n180\u306f\u53f3\u304b\u3089\u5de6\u3001<br \/>\n270\u306f\u4e0a\u304b\u3089\u4e0b\u3002<\/td>\n<\/tr>\n<tr>\n<td>android:centerX<\/td>\n<td>\u6a2a\u8ef8\u306e\u4e2d\u5fc3\u306e\u4f4d\u7f6e\u30920\uff5e1.0\u3067\u6307\u5b9a\u3002<\/td>\n<\/tr>\n<tr>\n<td>android:centerY<\/td>\n<td>\u7e26\u8ef8\u306e\u4e2d\u5fc3\u306e\u4f4d\u7f6e\u30920\uff5e1.0\u3067\u6307\u5b9a\u3002<\/td>\n<\/tr>\n<tr>\n<td>android:centerColor<\/td>\n<td>\u00a0\u958b\u59cb\u306e\u8272\u3068\u7d42\u308f\u308a\u306e\u8272\u306e\u4e2d\u9593\u8272<\/td>\n<\/tr>\n<tr>\n<td>android:endColor<\/td>\n<td>\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3\u306e\u7d42\u308f\u308a\u306e\u8272<\/td>\n<\/tr>\n<tr>\n<td>android:gradientRadius<\/td>\n<td>android:type=&#8221;radial&#8221;\u306e\u3068\u304d\u306e\u307f\u6307\u5b9a\u53ef\u80fd\u3002<br \/>\n\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3\u306e\u534a\u5f84\u3092dp\u3067\u6307\u5b9a\u3002<\/td>\n<\/tr>\n<tr>\n<td>android:startColor<\/td>\n<td>\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u59cb\u306e\u8272<\/td>\n<\/tr>\n<tr>\n<td>android:type<\/td>\n<td>linear\u306f\u3001\u76f4\u7dda\u306e\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3<br \/>\nradial\u306f\u3001\u653e\u5c04\u72b6\u306e\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3<br \/>\nsweep\u306f\u3001\u5186\u5f62\u306e\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3<\/td>\n<\/tr>\n<tr>\n<td>android:useLevel<\/td>\n<td>true\u306f\u3001LevelListDrawable\u3068\u3057\u3066\u4f7f\u3046\u5834\u5408\u306b\u6307\u5b9a\u3002<br \/>\nfalase\u306f\u4f7f\u308f\u306a\u3044\u5834\u5408\u306b\u6307\u5b9a\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>&lt;padding \/&gt;<\/h3>\n<p>\u5185\u90e8\u306e\u4f59\u767d\u306e\u6307\u5b9a\u3002<br \/>\n&lt;shape&gt;\uff5e&lt;\/shape&gt;\u5185\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<table class=\"t2\">\n<tbody>\n<tr>\n<td>android:left<\/td>\n<td>\u5de6\u7aef\u304b\u3089\u306e\u4f59\u767d\u3092dp\u3067\u6307\u5b9a<\/td>\n<\/tr>\n<tr>\n<td>android:top<\/td>\n<td>\u4e0a\u7aef\u304b\u3089\u306e\u4f59\u767d\u3092dp\u3067\u6307\u5b9a<\/td>\n<\/tr>\n<tr>\n<td>android:right<\/td>\n<td>\u53f3\u7aef\u304b\u3089\u306e\u4f59\u767d\u3092dp\u3067\u6307\u5b9a<\/td>\n<\/tr>\n<tr>\n<td>android:bottom<\/td>\n<td>\u4e0b\u7aef\u304b\u3089\u306e\u4f59\u767d\u3092dp\u3067\u6307\u5b9a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>&lt;size \/&gt;<\/h3>\n<p>\u56f3\u5f62\u306e\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n&lt;shape&gt;\uff5e&lt;\/shape&gt;\u5185\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<table class=\"t2\">\n<tbody>\n<tr>\n<td>android:width<\/td>\n<td>\u56f3\u5f62\u306e\u5e45\u3092dp\u3067\u6307\u5b9a<\/td>\n<\/tr>\n<tr>\n<td>android:height<\/td>\n<td>\u56f3\u5f62\u306e\u9ad8\u3055\u3092dp\u3067\u6307\u5b9a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>&lt;solid \/&gt;<\/h3>\n<p>\u80cc\u666f\u8272\u3092\u5358\u4e00\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n&lt;shape&gt;\uff5e&lt;\/shape&gt;\u5185\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<td>android:color<\/td>\n<td>@color\/\u8272\u540d<br \/>\n#cccccc<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u300cres\\value\\color.xml\u300d\u306b\u8a2d\u5b9a\u3057\u305f\u8272\u540d\uff08\u30ab\u30e9\u30fc\u30ea\u30bd\u30fc\u30b9\uff09\u3092\u6307\u5b9a\u3059\u308b\u304b\u3001\u300c#cccccc\u300d\u306e\u3088\u3046\u306b16\u9032\u5024\u3092\u6307\u5b9a\u3059\u308b\u3001\u3068\u3044\u3046\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>&lt;stroke \/&gt;<\/h3>\n<p>\u67a0\u7dda\u306e\u592a\u3055\u3084\u8272\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n&lt;shape&gt;\uff5e&lt;\/shape&gt;\u5185\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<table class=\"t2\">\n<tbody>\n<tr>\n<td>android:width<\/td>\n<td>\u67a0\u7dda\u306e\u592a\u3055\u3092dp\u3067\u6307\u5b9a<\/td>\n<\/tr>\n<tr>\n<td>android:color<\/td>\n<td>\u67a0\u7dda\u306e\u8272\u3092\u6307\u5b9a\uff08xml\u30d5\u30a1\u30a4\u30eb\u3082\u3057\u304f\u306f16\u9032\u5024\uff09<\/td>\n<\/tr>\n<tr>\n<td>android:dashWidth<\/td>\n<td>\u7834\u7dda\u306e\u7dda\u306e\u9577\u3055\u3092dp\u3067\u6307\u5b9a<\/td>\n<\/tr>\n<tr>\n<td>android:dashGap<\/td>\n<td>\u7834\u7dda\u306e\u9593\u9694\u3092dp\u3067\u6307\u5b9a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>dp\u3067\u6307\u5b9a\u3059\u308b\u3082\u306e\u306f\u3001\u5225\u9014xml\u30d5\u30a1\u30a4\u30eb\u3067\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3\u30ea\u30bd\u30fc\u30b9\u3092\u8a2d\u5b9a\u3057\u3066\u304a\u3051\u3070\u3001\u540d\u524d\u3067\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"source\">\n<pre>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;resources&gt;\r\n&lt;dimen name=\"stroke_width\"&gt;5dp&lt;\/dimen&gt;\r\n&lt;dimen name=\"font_size\"&gt;24sp&lt;\/dimen&gt;\r\n&lt;\/resources&gt;<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Android Studio\u3067\u3001\u30dc\u30bf\u30f3\u306a\u3069\u306e\u8272\u3084\u5f62\u306e\u6307\u5b9a\u3092\u3059\u308b\u969b\u30011\u3064\u306exml\u30d5\u30a1\u30a4\u30eb\u3067\u3001\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u305f\u3068\u304d\u3068\u62bc\u3057\u3066\u3044\u306a\u3044\u3068\u304d\u306e\u72b6\u614b\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002 xml\u30d5\u30a1\u30a4\u30eb\u306e\u6307\u5b9a Android Stud&#8230;<span class=\"continue\"><a href=\"https:\/\/kuuur.net\/?p=1877\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-1877","post","type-post","status-publish","format-standard","hentry","category-android"],"views":8102,"_links":{"self":[{"href":"https:\/\/kuuur.net\/index.php?rest_route=\/wp\/v2\/posts\/1877","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kuuur.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kuuur.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kuuur.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kuuur.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1877"}],"version-history":[{"count":7,"href":"https:\/\/kuuur.net\/index.php?rest_route=\/wp\/v2\/posts\/1877\/revisions"}],"predecessor-version":[{"id":1884,"href":"https:\/\/kuuur.net\/index.php?rest_route=\/wp\/v2\/posts\/1877\/revisions\/1884"}],"wp:attachment":[{"href":"https:\/\/kuuur.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kuuur.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kuuur.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}