2016-03-13 8 views
1

Я сделал группу радио с некоторыми линейными макетами (с ними в них были текстовые и радиокниги). Я могу выбрать несколько вариантов этой группы, которую я не хочу. Как удалить эту вещь?В группе RadioGroup выбраны опционы множественного доступа

 <RadioGroup 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:id="@+id/rg"> 

         <LinearLayout 
          android:layout_width="match_parent" 
          android:layout_height="wrap_content" 
          android:id="@+id/ll1" 
          android:orientation="horizontal"> 

          <RadioButton 
           android:layout_width="fill_parent" 
           android:layout_height="wrap_content" 
           android:layout_marginTop="10dp" 
           android:text="Option1" 
           android:textColor="#ffffff" 
           android:textSize="15sp" 
           android:layout_weight="0.5" 
           android:checked="false" 
           android:id="@+id/rbOption1" /> 

          <TextView 
           android:layout_width="fill_parent" 
           android:layout_height="match_parent" 
           android:layout_weight="1.5" 
           android:id="@+id/oc1" />  

         </LinearLayout> 


         <LinearLayout 
          android:layout_width="match_parent" 
          android:layout_height="wrap_content" 
          android:id="@+id/ll2" 
          android:orientation="horizontal"> 

          <RadioButton 
           android:layout_width="fill_parent" 
           android:layout_height="fill_parent" 
           android:id="@+id/rbOption2" 
           android:layout_marginTop="10dp" 
           android:text="Option2" 
           android:textColor="#ffffff" 
           android:textSize="15sp" 
           android:layout_weight="0.5"/> 

          <TextView 
           android:layout_width="fill_parent" 
           android:layout_height="fill_parent" 
           android:layout_weight="1.5" 
           android:id="@+id/oc2" /> 



         </LinearLayout> 
</RadioGroup> 
+0

делает это [это] (http://stackoverflow.com/a/16811546/5647037) решить его для вас? – Vucko

ответ

0

К сожалению, RadioGroup работает только тогда, когда RadioButtons являются его непосредственными детьми. Вам придется либо реализовать поведение самостоятельно, либо перепроектировать макет.