Escolar Documentos
Profissional Documentos
Cultura Documentos
Checkbox
code in
XML
<Checkbox
android:id=@+id/simpleCheckBo
x
android:layout_width=wrap_cont
ent
android:layout_height=wrap_con
tent
android:text=Simple
CheckBox />
Checkbox
<Checkbox
android:id=@+id/simpleCheckBox
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=Simple CheckBox />
checked
<Checkbox
android:id=@+id/simpleCheckBox
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=Simple CheckBox
android:checked=true /> <--set the current state of
the checkbox--!>
gravity
<Checkbox
android:id=@+id/simpleCheckBox
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=Simple CheckBox
android:checked=true
android:text=Text Attribute of Check Box /> <!
displays text of the checkbox--!>
textColor
<Checkbox
android:id=@+id/simpleCheckBox
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=Text is Red Color
android:textColor=#f00 <!red color for the text of
checkbox--!>
android:checked=true />
textSize
<Checkbox
android:id=@+id/simpleCheckBox
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=Text size Attribute Of Check Box
android:textColor=#00f
android:checked=false
android:textSize=20sp /> <!set the text size of
text in checkbox--!>
textStyle
Used to set the text style of the text of a checkbox.
<Checkbox
android:id=@+id/simpleCheckBox
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=Text Style Attribute Of Check Box
android:textColor=#44f
android:textSize=20sp
android:checked=false
android:textStyle=bold|italic /> <!set the text
style of text in checkbox--!>
background
Used to set the background of a checkbox.
<Checkbox
android:id=@+id/simpleCheckBox
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=Text size Attribute Of Check Box
android:textColor=#fff
android:textSize=20sp
android:textStyle=bold|italic
android:checked=true
android:background=#000 /> <!black
background for the background of checkbox--!>
padding
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=Padding Attribute Of
Check Box
android:textColor=#44f
android:textSize=20sp
android:textStyle=bold|italic
android:checked=false
android:padding=30dp /> <!
30dp padding from all sides--!>