{"id":10671,"date":"2020-12-05T15:05:59","date_gmt":"2020-12-05T06:05:59","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=10671"},"modified":"2020-12-05T15:48:25","modified_gmt":"2020-12-05T06:48:25","slug":"%ec%95%88%eb%93%9c%eb%a1%9c%ec%9d%b4%eb%93%9c%ec%9d%98-xml%eb%a1%9c%eb%b6%80%ed%84%b0-view-%ec%83%9d%ec%84%b1%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=10671","title":{"rendered":"[Android] XML\ub85c\ubd80\ud130 View \uc0dd\uc131\ud558\uae30"},"content":{"rendered":"<p>\uc548\ub4dc\ub85c\uc774\ub4dc\ub294 UI\uc758 \uad6c\uc131\uc744 XML\ub85c \uc815\uc758\ud558\uc5ec \uc0dd\uc131\ud55c\ub2e4. \uc544\ub798\ub294 UI\ub97c \uc704\ud55c XML\uc778 map_legend_item.xml \ud30c\uc77c\uc774\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=\"wrap_content\"\r\n    android:orientation=\"vertical\" >\r\n\r\n    &lt;LinearLayout\r\n        android:paddingHorizontal=\"15dp\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"54dp\"\r\n        android:gravity=\"center_vertical\"\r\n        android:orientation=\"horizontal\">\r\n\r\n        &lt;Switch\r\n            android:id=\"@+id\/swLayerVisibility\"\r\n            android:layout_weight=\"0\"\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"wrap_content\" \/>\r\n\r\n        &lt;geoservice.nexgen.maplegend.LegendSingleSymbol\r\n            android:id=\"@+id\/lssItem\"\r\n            android:layout_width=\"36dp\"\r\n            android:layout_height=\"36dp\" \/>\r\n\r\n        &lt;Space\r\n            android:layout_width=\"5dp\"\r\n            android:layout_height=\"1px\" \/>\r\n\r\n        &lt;TextView\r\n            android:layout_weight=\"1\"\r\n            android:id=\"@+id\/tvLayerName\"\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:textSize=\"@dimen\/normal_text_size\"\r\n            android:textStyle=\"bold\"\r\n            android:text=\"LayerName\" \/>\r\n\r\n\r\n    &lt;\/LinearLayout>\r\n&lt;\/LinearLayout>\r\n<\/pre>\n<p>\uc704\uc758 XML\uc744 \ud1b5\ud574 View\ub97c \uc0dd\uc131\ud558\ub294 \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"kotlin\">\r\nfor( ... ) {\r\n    val itemLayout = inflater.inflate(R.layout.map_legend_item, null, false)\r\n    itemLayout.findViewById&lt;TextView>(R.id.tvLayerName).setText(title)\r\n\r\n    ...\r\n\r\n    mainLayout.addView(itemLayout)\r\n}\r\n<\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc \uc911 inflater\ub294 \ub2e4\uc74c 3\uac00\uc9c0 \ubc29\uc2dd \uc911 \ud558\ub098\ub97c \ud1b5\ud574 \uc0dd\uc131\ub41c\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"kotlin\">\r\nval inflater = layoutInflater\r\nval inflater = LayoutInflater.from(this)\r\nval inflater = getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater\r\n<\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc\ub97c \ud1b5\ud55c \uc2e4\uc81c \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2020\/12\/nexgen_mobile_legend.png\" alt=\"\" width=\"500\" class=\"aligncenter size-full wp-image-10673\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc548\ub4dc\ub85c\uc774\ub4dc\ub294 UI\uc758 \uad6c\uc131\uc744 XML\ub85c \uc815\uc758\ud558\uc5ec \uc0dd\uc131\ud55c\ub2e4. \uc544\ub798\ub294 UI\ub97c \uc704\ud55c XML\uc778 map_legend_item.xml \ud30c\uc77c\uc774\ub2e4. &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?> &lt;LinearLayout xmlns:android=&#8221;http:\/\/schemas.android.com\/apk\/res\/android&#8221; android:layout_width=&#8221;match_parent&#8221; android:layout_height=&#8221;wrap_content&#8221; android:orientation=&#8221;vertical&#8221; > &lt;LinearLayout android:paddingHorizontal=&#8221;15dp&#8221; android:layout_width=&#8221;match_parent&#8221; android:layout_height=&#8221;54dp&#8221; android:gravity=&#8221;center_vertical&#8221; android:orientation=&#8221;horizontal&#8221;> &lt;Switch android:id=&#8221;@+id\/swLayerVisibility&#8221; android:layout_weight=&#8221;0&#8243; android:layout_width=&#8221;wrap_content&#8221; android:layout_height=&#8221;wrap_content&#8221; \/> &lt;geoservice.nexgen.maplegend.LegendSingleSymbol android:id=&#8221;@+id\/lssItem&#8221; android:layout_width=&#8221;36dp&#8221; android:layout_height=&#8221;36dp&#8221; \/> &lt;Space android:layout_width=&#8221;5dp&#8221; android:layout_height=&#8221;1px&#8221; \/> &lt;TextView android:layout_weight=&#8221;1&#8243; android:id=&#8221;@+id\/tvLayerName&#8221; android:layout_width=&#8221;wrap_content&#8221; android:layout_height=&#8221;wrap_content&#8221; android:textSize=&#8221;@dimen\/normal_text_size&#8221; android:textStyle=&#8221;bold&#8221; android:text=&#8221;LayerName&#8221; \/> &lt;\/LinearLayout> &lt;\/LinearLayout> \uc704\uc758 XML\uc744 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=10671\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;[Android] XML\ub85c\ubd80\ud130 View \uc0dd\uc131\ud558\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-10671","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\/10671","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=10671"}],"version-history":[{"count":6,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10671\/revisions"}],"predecessor-version":[{"id":10685,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10671\/revisions\/10685"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10671"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}