{"id":1011,"date":"2020-10-06T00:59:21","date_gmt":"2020-10-05T15:59:21","guid":{"rendered":"http:\/\/leenux.kr\/?p=1011"},"modified":"2020-10-06T02:25:56","modified_gmt":"2020-10-05T17:25:56","slug":"android-studio-linearlayout","status":"publish","type":"post","link":"https:\/\/leenux.kr\/?p=1011","title":{"rendered":"android studio LinearLayout"},"content":{"rendered":"\n<p class=\"has-text-color has-medium-font-size has-very-dark-gray-color\"><strong>Android studio Layout XML \ub514\uc790\uc778 \ubd80\ubd84\uc778 LinearLayout \ub300\ud574 \uc54c\uc544\ubcf8\ub2e4.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\" # \uac00\ub85c \n    tools:context=\".MainActivity\">\n\n   &lt;Button\n        android:text=\"\ubc84\ud2bc\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_weight=\"1\"\/>\n\n&lt;\/LinearLayout><\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-medium-font-size has-very-dark-gray-color\"><strong>android:orientation\uc740 LinearLayout\ud558\uc704\uc5d0 \ubc30\uce58\ub418\ub294 \ubc84\ud2bc, \ud14d\uc2a4\ud2b8\ubdf0\ub4f1\uc744 \uc138\ub85c or \uac00\ub85c\uc73c\ub85c \ubc30\uce58\ud560\uac70\ub0d0\ub294 \ucf54\ub4dc\uc774\ub2e4.<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-medium-font-size has-very-dark-gray-color\"><strong>\uac00\ub85c : android:orientation=&#8221;vertical&#8221;<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"273\" height=\"484\" src=\"https:\/\/leenux.kro.kr\/wp-content\/uploads\/2020\/10\/image-1.png\" alt=\"\" class=\"wp-image-1013\" srcset=\"https:\/\/leenux.kr\/wp-content\/uploads\/2020\/10\/image-1.png 273w, https:\/\/leenux.kr\/wp-content\/uploads\/2020\/10\/image-1-169x300.png 169w, https:\/\/leenux.kr\/wp-content\/uploads\/2020\/10\/image-1-230x408.png 230w\" sizes=\"(max-width: 273px) 100vw, 273px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-medium-font-size has-very-dark-gray-color\"><strong>\uc138\ub85c : android:orientation=&#8221;horizontal&#8221;<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"276\" height=\"484\" src=\"https:\/\/leenux.kro.kr\/wp-content\/uploads\/2020\/10\/image-2.png\" alt=\"\" class=\"wp-image-1014\" srcset=\"https:\/\/leenux.kr\/wp-content\/uploads\/2020\/10\/image-2.png 276w, https:\/\/leenux.kr\/wp-content\/uploads\/2020\/10\/image-2-171x300.png 171w, https:\/\/leenux.kr\/wp-content\/uploads\/2020\/10\/image-2-230x403.png 230w\" sizes=\"(max-width: 276px) 100vw, 276px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-large-font-size has-very-dark-gray-color\"><strong>LInearLayout Visibility<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-medium-font-size has-very-dark-gray-color\"><strong>XML<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?>\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"\n    tools:context=\".MainActivity\">\n\n    &lt;LinearLayout\n        android:id=\"@+id\/linearLayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"100dp\"\n        android:background=\"#000000\"\n        android:orientation=\"vertical\"\/>\n\n    &lt;Button\n        android:id=\"@+id\/LinearLayoutButton\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"60dp\"\n        android:text=\"LinearLayout OFF\" \/>\n\n&lt;\/LinearLayout><\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-medium-font-size has-very-dark-gray-color\"><strong>Java<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import androidx.appcompat.app.AppCompatActivity;\n\nimport android.os.Bundle;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.LinearLayout;\n\npublic class LinearLayout_Activity extends AppCompatActivity {\n\n    LinearLayout linearLayout;\n    Button linearLayoutButton;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_linear_layout);\n\n        linearLayout = findViewById(R.id.linearLayout);\n        linearLayoutButton = findViewById(R.id.linearLayoutButton);\n\n        linearLayoutButton.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View view) {\n                int visibilityStatus = linearLayout.getVisibility(); \/\/ LinearLayout Visibility \uc0c1\ud0dc\ud655\uc778\n                if (visibilityStatus == View.GONE){\n                    linearLayoutButton.setText(\"LinearLayout ON\");\n                    linearLayout.setVisibility(View.VISIBLE);\n                }else if (visibilityStatus == View.VISIBLE){\n                    linearLayoutButton.setText(\"LinearLayout OFF\");\n                    linearLayout.setVisibility(View.GONE);\n                }\n            }\n        });\n    }\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/leenux.kro.kr\/wp-content\/uploads\/2020\/10\/Screen_Recording_20201006-0217481.mp4\"><\/video><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Android studio Layout XML \ub514\uc790\uc778 \ubd80\ubd84\uc778 LinearLayout \ub300\ud574 \uc54c\uc544\ubcf8\ub2e4. android:orientation\uc740 LinearLayout\ud558\uc704\uc5d0 \ubc30\uce58\ub418\ub294 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1017,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/posts\/1011"}],"collection":[{"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/leenux.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1011"}],"version-history":[{"count":3,"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions"}],"predecessor-version":[{"id":1022,"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions\/1022"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/media\/1017"}],"wp:attachment":[{"href":"https:\/\/leenux.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/leenux.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/leenux.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}