{"id":10715,"date":"2020-12-22T09:20:37","date_gmt":"2020-12-22T00:20:37","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=10715"},"modified":"2021-01-04T07:14:03","modified_gmt":"2021-01-03T22:14:03","slug":"drawer-menu-%ed%95%ad%eb%aa%a9%ec%9d%98-%ec%9a%b0%ec%b8%a1%ec%97%90-%ec%bb%a4%ec%8a%a4%ed%85%80-%eb%b7%b0custom-view-%eb%8b%ac%ea%b8%b0","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=10715","title":{"rendered":"Drawer Menu \ud56d\ubaa9\uc758 \uc6b0\uce21\uc5d0 \ucee4\uc2a4\ud140 \ubdf0(Custom View) \ub2ec\uae30"},"content":{"rendered":"<p>Drawer Menu\ub294 \uc548\ub4dc\ub85c\uc774\ub4dc\uc758 \ud45c\uc900\ud654\ub41c \uba54\ub274\uc785\ub2c8\ub2e4. \uc774 UI\ub294 \ub2e8\uc21c\ud788 \uba54\ub274\ub85c\uc368\uc758 \uae30\ub2a5 \ubfd0\ub9cc\uc774 \uc544\ub2c8\ub77c \ub2e4\uc591\ud55c \uc815\ubcf4\ub97c \uc0ac\uc6a9\uc790\uc5d0\uac8c \uc81c\uacf5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub97c \uc704\ud574 Drawable\uc758 \ud2b9\uc815 \uba54\ub274 \ud56d\ubaa9\uc758 \uc6b0\uce21\uc5d0 \ucee4\uc2a4\ud140 \ubdf0\ub97c \ub2ec\uac8c \ub418\uba74, \uc774 \ucee4\uc2a4\ud140 \ubdf0\uc758 \ub0b4\uc6a9\uc744 \ubcc0\uacbd\ud568\uc73c\ub85c\uc368 \uc5b4\ub5a4 \uc815\ubcf4\ub97c \uc0ac\uc6a9\uc790\uc5d0\uac8c \uc804\ub2ec\ud560 \uc218 \uc788\uac8c \ub429\ub2c8\ub2e4. \uc774 \uae00\uc740 \uc774\ucc98\ub7fc Drawable\uc758 \ud2b9\uc815 \uba54\ub274 \ud56d\ubaa9\uc5d0 \ucee4\uc2a4\ud140 \ubdf0\ub97c \ucd94\uac00\ud558\ub294 \ucf54\ub4dc\ub97c \uc815\ub9ac\ud569\ub2c8\ub2e4.<\/p>\n<p>Drawer Menu\ub97c \ucd94\uac00\ud558\uae30 \uc704\ud574\uc11c\ub294 Activity\uc758 Layout\uc5d0\uc11c \uae30\ubcf8\uc801\uc73c\ub85c com.google.android.material.navigation.NavigationView\ub97c \uc0ac\uc6a9\ud558\uac8c \ub429\ub2c8\ub2e4. \uc774\ub97c NavigationView\ub97c \ud1b5\ud574 \uba54\ub274\uc758 \uac01 \ud56d\ubaa9\uc5d0 \uc811\uadfc\ud560 \uc218 \uc788\uace0, \uc811\uadfc\ub41c \uba54\ub274\uc5d0 \uc6d0\ud558\ub294 View\ub97c \uc9c0\uc815\ud560 \uc218 \uc788\uac8c \ub429\ub2c8\ub2e4. \uc544\ub798 \ucf54\ub4dc\ucc98\ub7fc\uc694.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"kotlin\">\r\nnavigationView = findViewById&lt;NavigationView>(R.id.main_navigation_view)\r\n\r\n    ...\r\n\r\nnavigationView.getMenu().getItem(4).setActionView(R.layout.drawer_menu_item_collecting_data_searched_items_count)\r\n<\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc\ub294 5\ubc88\uc9f8 \uba54\ub274\uc5d0 \ub300\ud55c \ucee4\uc2a4\ud140 \ubdf0\ub97c R.layout.drawer_menu_item_collecting_data_searched_items_count\uc73c\ub85c \uc9c0\uc815\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. R.layout.drawer_menu_item_collecting_data_searched_items_count\uc5d0 \ub300\ud55c \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"xml\">\r\n&lt;?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:gravity=\"center_vertical\"\r\n    android:orientation=\"vertical\" >\r\n\r\n    &lt;TextView\r\n        android:background=\"@drawable\/rounding_box\"\r\n        android:id=\"@+id\/tvResultItemCount\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:textColor=\"#ffffff\"\r\n        android:textSize=\"@dimen\/very_small_text_size\"\r\n        android:paddingVertical=\"2dp\"\r\n        android:paddingHorizontal=\"10dp\"\r\n        android:text=\"0\" \/>\r\n\r\n&lt;\/LinearLayout>\r\n<\/pre>\n<p>\uc704\uc758 \ubdf0\ub97c \uc880\ub354 \uc2dc\uac01\uc801\uc73c\ub85c \uc548\uc815\uac10 \uc788\ub3c4\ub85d \ubc30\uacbd\uc744 rounding_box\ub77c\ub294 Drawable\ub85c \uc9c0\uc815\ud558\uc600\ub294\ub370\uc694. rounding_box \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"xml\">\r\n&lt;shape xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\">\r\n    &lt;solid android:color=\"@color\/uiColor\" \/>\r\n    &lt;padding\r\n        android:left=\"45px\"\r\n        android:top=\"15px\"\r\n        android:right=\"45px\"\r\n        android:bottom=\"15px\" \/>\r\n    &lt;corners android:radius=\"30px\" \/>\r\n&lt;\/shape>\r\n<\/pre>\n<p>\uc55e\uc11c \uc5b8\uae09\ud588\ub358 \uac83\ucc98\ub7fc Drawer Menu\uc758 \ud56d\ubaa9\uc5d0 \ub300\ud55c \ucee4\uc2a4\ud140 \ubdf0\uc758 \ub0b4\uc6a9\uc744 \ubcc0\uacbd\ud568\uc73c\ub85c\uc368 \uc815\ubcf4\ub97c \uc0ac\uc6a9\uc790\uc5d0\uac8c \uc804\ub2ec\ud55c\ub2e4\uace0 \ud588\ub294\ub370, \ucee4\uc2a4\ud140 \ubdf0\ub97c \ubcc0\uacbd\ud558\ub294 \ucf54\ub4dc\uc758 \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"kotlin\">\r\nnavigationView.getMenu().getItem(4).actionView.findViewById&lt;TextView>(R.id.tvResultItemCount).text = \"999\"\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Drawer Menu\ub294 \uc548\ub4dc\ub85c\uc774\ub4dc\uc758 \ud45c\uc900\ud654\ub41c \uba54\ub274\uc785\ub2c8\ub2e4. \uc774 UI\ub294 \ub2e8\uc21c\ud788 \uba54\ub274\ub85c\uc368\uc758 \uae30\ub2a5 \ubfd0\ub9cc\uc774 \uc544\ub2c8\ub77c \ub2e4\uc591\ud55c \uc815\ubcf4\ub97c \uc0ac\uc6a9\uc790\uc5d0\uac8c \uc81c\uacf5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub97c \uc704\ud574 Drawable\uc758 \ud2b9\uc815 \uba54\ub274 \ud56d\ubaa9\uc758 \uc6b0\uce21\uc5d0 \ucee4\uc2a4\ud140 \ubdf0\ub97c \ub2ec\uac8c \ub418\uba74, \uc774 \ucee4\uc2a4\ud140 \ubdf0\uc758 \ub0b4\uc6a9\uc744 \ubcc0\uacbd\ud568\uc73c\ub85c\uc368 \uc5b4\ub5a4 \uc815\ubcf4\ub97c \uc0ac\uc6a9\uc790\uc5d0\uac8c \uc804\ub2ec\ud560 \uc218 \uc788\uac8c \ub429\ub2c8\ub2e4. \uc774 \uae00\uc740 \uc774\ucc98\ub7fc Drawable\uc758 \ud2b9\uc815 \uba54\ub274 \ud56d\ubaa9\uc5d0 \ucee4\uc2a4\ud140 \ubdf0\ub97c \ucd94\uac00\ud558\ub294 \ucf54\ub4dc\ub97c \uc815\ub9ac\ud569\ub2c8\ub2e4. Drawer Menu\ub97c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=10715\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Drawer Menu \ud56d\ubaa9\uc758 \uc6b0\uce21\uc5d0 \ucee4\uc2a4\ud140 \ubdf0(Custom View) \ub2ec\uae30&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"class_list":["post-10715","post","type-post","status-publish","format-standard","hentry","category-android"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10715"}],"version-history":[{"count":8,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10715\/revisions"}],"predecessor-version":[{"id":10765,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10715\/revisions\/10765"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10715"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}