BASVIN
BASVIN

Reputation: 1

Checkbox text not appearing in android studio

Check box text not appearing in my layout file in android studio. This is the xml code.

layout image.

Only text "checkbox" appears. I have used styles for check boxes and placed the check boxes inside the scroll view.

<ScrollView
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:fillViewport="false"
    android:orientation="vertical"
    android:padding="5dp">


    <LinearLayout style="@style/QuestionSetStyle">

        <TextView
            style="@style/QuestionStyle"
            android:text="@string/text_Q1" />

        <LinearLayout style="@style/AnswerSetStyle">

            <CheckBox
                android:id="@+id/cb_1_a"
                style="@style/CheckBox"
                android:textColor="#ffff00"
                android:text="@string/text_FRANCE" />

            <CheckBox
                android:id="@+id/cb_1_b"
                style="@style/CheckBox"
                android:text="@string/text_BEIJING" />

        </LinearLayout>

        <LinearLayout style="@style/AnswerSetStyle">


            <CheckBox
                android:id="@+id/cb_1_c"
                style="@style/CheckBox"
                android:text="@string/text_NEWDELHI" />


            <CheckBox
                android:id="@+id/cb_1_d"
                style="@style/CheckBox"
                android:text="@string/text_SEOUL" />

        </LinearLayout>
    </LinearLayout>


</ScrollView>

Upvotes: 0

Views: 1105

Answers (1)

Amir Uval
Amir Uval

Reputation: 14873

Try this:

        <CheckBox
            android:id="@+id/cb_1_a"
            style="@style/CheckBox"
            tools:text="try this"
            android:textColor="#ffff00"
            android:text="@string/text_FRANCE" />

and add this to the root view:

      xmlns:tools="http://schemas.android.com/tools"

Upvotes: 1

Related Questions