2016-07-30 60 views
0

复选框文本没有出现在我的布局文件在android studio中。这是xml代码。 layout image。文本“复选框”只出现。已使用复选框的样式,并将复选框放在滚动视图中。复选框文本没有出现在android工作室

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