2016-12-13 7 views
0

대신 RadioButton에 수학 공식을 표시해야합니다.
Formulas examples 이 수식을 표시하려면 MathJax을 사용하고 있지만 MathJaxTextView이 아닌 WebView의 수식을 표시해야합니다. 나는 각 RadioButton + WebView에 대한 LinearLayout 수평을 만들고 RadioGroup에이 모든 것을 넣어 시도,하지만 난 항상 확인하는 RadioButton을 확인할 때 슬프게도, 아마도 RadioGroupLinearLayout의 원인이 작동하지 않습니다.RadioButton에 WebView를 표시하는 방법은 무엇입니까?

봐 :

<!--******************************* CUSTOM RADIOGROUP *******************************--> 
     <RadioGroup 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/RadioWebView" 
      android:layout_below="@+id/rd_group_id"> 


      <!--******************************* QUESTAO 1 ***********************************--> 
      <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:orientation="horizontal" 
      android:id="@+id/questao1" 
      android:layout_marginTop="10dp"> 
      <RadioButton 
       android:id="@+id/ebRadio1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:checked="false" 
       /> 

      <io.github.kexanie.library.MathView 
       android:id="@+id/webviewQuestao1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       auto:text="\\(x \\over 2\\)" 
       auto:engine="MathJax" 
       android:layout_below="@+id/tv_QuestaoTexto" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true"> 
      </io.github.kexanie.library.MathView> 
     </LinearLayout> 


      <!--******************************* QUESTAO 2 ***********************************--> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="horizontal" 
       android:id="@+id/questao2" 
       android:layout_marginTop="10dp"> 
       <RadioButton 
        android:id="@+id/ebRadio2" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        /> 

       <io.github.kexanie.library.MathView 
        android:id="@+id/webviewQuestao2" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        auto:text="\\(-x \\over 2\\)" 
        auto:engine="MathJax" 
        android:layout_below="@+id/tv_QuestaoTexto" 
        android:layout_alignParentLeft="true" 
        android:layout_alignParentStart="true"> 
       </io.github.kexanie.library.MathView> 
      </LinearLayout> 


      <!--******************************* QUESTAO 3 ***********************************--> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="horizontal" 
       android:id="@+id/questao3" 
       android:layout_marginTop="10dp"> 
       <RadioButton 
        android:id="@+id/ebRadio3" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        /> 

       <io.github.kexanie.library.MathView 
        android:id="@+id/webviewQuestao3" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        auto:text="\\(x \\sqrt {2}\\)" 
        auto:engine="MathJax" 
        android:layout_below="@+id/tv_QuestaoTexto" 
        android:layout_alignParentLeft="true" 
        android:layout_alignParentStart="true"> 
       </io.github.kexanie.library.MathView> 
      </LinearLayout> 


      <!--******************************* QUESTAO 4 ***********************************--> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="horizontal" 
       android:id="@+id/questao4" 
       android:layout_marginTop="10dp"> 
       <RadioButton 
        android:id="@+id/ebRadio4" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        /> 

       <io.github.kexanie.library.MathView 
        android:id="@+id/webviewQuestao4" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        auto:text="\\({x \\sqrt {2}}\\over 23^{x+y+z}\\)" 
        auto:engine="MathJax" 
        android:layout_below="@+id/tv_QuestaoTexto" 
        android:layout_alignParentLeft="true" 
        android:layout_alignParentStart="true"> 
       </io.github.kexanie.library.MathView> 
      </LinearLayout> 


      <!--******************************* QUESTAO 5 ***********************************--> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="horizontal" 
       android:id="@+id/questao5" 
       android:layout_marginTop="10dp"> 
       <RadioButton 
        android:id="@+id/ebRadio5" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        /> 

       <io.github.kexanie.library.MathView 
        android:id="@+id/webviewQuestao5" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        auto:text="\\(y = {{{x \\sqrt {2}}\\over 23^{x+y+z}}-{x \\sqrt {xy+53}}\\over R^{3+y+z}}\\)" 
        auto:engine="MathJax" 
        android:layout_below="@+id/tv_QuestaoTexto" 
        android:layout_alignParentLeft="true" 
        android:layout_alignParentStart="true"> 
       </io.github.kexanie.library.MathView> 
      </LinearLayout> 


     </RadioGroup> 
     <!--******************************* CUSTOM RADIOGROUP *******************************--> 

그리고이 결과 : RESULT

누군가가 어떻게 WebView를 표시하거나 RadioButton uncheckable을 설정하는 아는 사람?
감사합니다.

답변

0

RadioGroup은 ViewGroup을 자식으로 허용하지 않습니다. 이 작업을 수행하는 유일한 방법은 개별 라디오 버튼을 사용하고 프로그래밍 방식으로 켜기/끄기 상태를 제어하는 ​​것입니다.

는 이상이 링크를 따르십시오 : 그것은 지금은 완벽하게 작동하고

How to group RadioButton from different LinearLayouts?

+0

, 감사합니다! –