簡體   English   中英

復選框文字未出現在android studio中

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM