[英]Checkbox text not appearing in android studio
复选框文字未显示在android studio的布局文件中。 这是xml代码。
布局图像 。
仅显示文本“复选框”。 我已经为复选框使用了样式,并将复选框放置在滚动视图内。
<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>
尝试这个:
<CheckBox
android:id="@+id/cb_1_a"
style="@style/CheckBox"
tools:text="try this"
android:textColor="#ffff00"
android:text="@string/text_FRANCE" />
并将其添加到根视图:
xmlns:tools="http://schemas.android.com/tools"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.