Checkboxxml

This section shows the complete code of the checkbox.xml. Create a new XML file in your project named checkbox.xml using the instructions outlined earlier in this chapter. Use the following code to model your file.

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation="vertical" android:layout_width="fill_parent"

android:layout_height="fill_parent" >

<CheckBox android:id="@+id/testCheckBox"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="This is the test CheckBox"/>

<Button android:id="@+id/layoutButton"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="Change Layout"/>

<Button android:id="@+id/textColorButton"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="Change Text Color"/>

</LinearLayout>

0 0

Post a comment