[μλλ‘μ΄λ μ€νλμ€] μλλ‘μ΄λ μμ ― λ€λ£¨κΈ°2 (μ»΄νμ΄λ λ²νΌ: 체ν¬λ°μ€, λΌλμ€ λ²νΌ, μ€μμΉ/ν κΈ λ²νΌ)
μ»΄νμ΄λ λ²νΌ
compoundButton ν΄λμ€λ Button ν΄λμ€μ νμ ν΄λμ€μ΄λ€. κ·Έ νμ λͺ©λ‘μλ
- CheckBox
- ToggleButton
- RadioButton
μ΄ μλ€. μ΄μ μ΄ νμ ν΄λμ€μ λν΄ μμ보μ.
CheckBox
체ν¬λ°μ€λ ν΄λ¦λ λ λ§λ€ μνκ° μ²΄ν¬ λλ μΈμ²΄ν¬λ‘ λ°λλ€.
μ¬λ¬ κ°μ 체ν¬λ°μ€κ° μμ΄λ μλ‘ λ 립μ μΌλ‘ λμ νλ€λ νΉμ§μ΄ μμ΄μ μ¬λ¬ κ°λ₯Ό λμμ 체ν¬ν λ μ¬μ©λλ€.

<CheckBox
android:id="@+id/androidBox"
android:text="μλλ‘μ΄λ ν΄λν°"
android:checked="true" />
<CheckBox
android:id="@+id/iphoneBox"
android:text="μμ΄ν° ν΄λν°" />
μμ κ°μ΄ μ½λλ₯Ό μννλ€λ©΄ μλμ κ°μ κ²°κ³Όκ° λμ¨λ€.

μ΄λ₯Ό ν΅ν΄ μ μ μλ κ²μ checkedμ κΈ°λ³Έ default κ°μ falseλΌλ μ ...
Switchμ ToggleButton
μ€μμΉμ ν κΈ λ²νΌμ μκΉμλ§ λ€λ₯΄κ³ μ¨/μ€νλ₯Ό νννλ μ©λλ λμΌνλ€.

<ToggleButton
android:id="@+id/tgBtn1"
android:checked="true"/>
<ToggleBUtton
android:id="@+id/tgBtn2"/>

RadioButtonκ³Ό RadioGroup
λΌλμ€λ²νΌμ 체ν¬λ°μ€μ xml / java λ©μλκ° λΉμ·νμ§λ§ μ©λλ λ€λ₯΄λ€.
RadioButtonμ μ¬μ©ν λλ ν κ°μ§λ§ κΈ°μ΅νμ. 체ν¬ν΄μΌν κ²μ΄ μ¬λ¬κ° μ€ νλμΌ κ²½μ°
RadioGroupμ λΌλμ€ λ²νΌμ λ΄μμ£Όλ μΌμ’
μ 컨ν
μ΄λ μν μ νλλ° λΌλμ€ λ²νΌμ λ²μλ₯Ό μ ννλλ° μ¬μ©λκ³€ νλ€.

<RadioGroup
android:id="@+id/radioGroup">
<RadioButton
android:id="@+id/btn"/>
<RadioButton
android:id="@+id/btn2"/>
</RadioGroup>