Reputation: 1
Check box text not appearing in my layout file in android studio. This is the xml code.
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
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