[Android] layout (2023.07.04)
Declared Attributes
button color ์์ฑ : background tint
inset : padding๊ณผ ์ ์ฌํ ๊ฐ๋ (์์ชฝ ์ฌ๋ฐฑ์ ์ฃผ๋ ์์ฑ)
layout color ์์ฑ : background
layout_weight : component ๋ฐฐ์น ๊ฐ์ค์น ์ค์
- view๋ค์ด ๊ฐ์ง๋ ๊ฐ์ค์น์ ๋ฐ๋ผ์ ๋์ ์ผ๋ก ํฌ๊ธฐ๊ฐ ๋ณํ๊ฒ ๋ง๋ค์ด์ฃผ๋ ์์ฑ
- width/heigh๊ฐ ๋์ ์ผ๋ก ๋ณํ ์ ์๋๋ก ์ธ๋ถ์ ์ํฅ์ ๋ฐ์ผ๋ฉด ์๋๋ค. ----> match_parent๋ฅผ ์ฌ์ฉํ ์ ์์
- ๊ฐ์ค์น๋ฅผ ์ฃผ๊ณ ์ถ์ผ๋ฉด width/height๊ฐ ๋์ ์ผ๋ก ๋ณํ ์ ์๋๋ก wrap_content ๋๋ 0dp ๊ฐ์ ์ค์ผ ํจ
์ดํ๋ฆฌ์ผ์ด์ ์์ ํ๋์ ํ๋ฉด์ ๋ง๋ค๊ณ ์ถ์ ๋ > activity ์์ฑ
editText : textView, plainText, password ๋ฑ ... > ํค๋ณด๋์ ํํ๊ฐ ๋ค๋ฆ
editText์ ์์ฑ
Text : ์ฌ์ฉ์๊ฐ ํ๋ํ๋ ๋ค ์ง์ฐ๊ณ ์
๋ ฅํด์ผ ํ๋ค.
hint : ์ฌ์ฉ์๊ฐ ์
๋ ฅํ๋ฉด ์๋์ผ๋ก ๋ด์ฉ์ด ์ฌ๋์ง
์ฌ์ฉ์๊ฐ ์ด๋ค ๊ฐ์ ์
๋ ฅํด์ผ ๋๋์ง ์ ๋ณด๋ฅผ ์๋ ค์ฃผ๋ ์์ฑ
AndroidManifest.xml
์๋๋ก์ด๋ 4๋ ๊ตฌ์ฑ์์ ๊ด๋ฆฌ
์ดํ๋ฆฌ์ผ์ด์
์ ์ฒซ๋ฒ์งธ ํ๋ฉด์ ๊ด๋ฆฌํ๋ ์ฝ๋ --> intent-filter
<intent-filter> ---> manifest.xml์์ ํ๋๋ง ์กด์ฌํด์ผ ํจ
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
emulator ์ฉ๋ ์ฐผ์ ๋ (๋ฒ๋ฒ ๊ฑฐ๋ฆด๋ ๋์ฒ๋ฒ)