2016-07-30 10 views
0

アンドロイドスタジオのレイアウトファイルにチェックボックスのテキストが表示されません。これがXMLコードです。 layout image。テキスト「チェックボックス」のみが表示されます。チェックボックスのスタイルを使用し、スクロールビュー内にチェックボックスを配置しました。アンドロイドスタジオにチェックボックスのテキストが表示されない

<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> 

+1

すぎ – Shaishav

+0

をチェックボックススタイルを共有するあなたは私の解決策を試してみましたか? – auval

答えて

1

このお試しください:

 <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" 
関連する問題