AppCompatRadioButton not shown

saravananMadheswaransaravananMadheswaran Member ✭✭
edited October 11 in Xamarin.Android

I have used Radiobutton for 19> version and used AppCompatRadioButton for lower version.

The strange thing is, text is appeared but the radio button not shown,

and we figured the issue is while using custom theme.

  <RadioGroup
    android:layout_width="match_parent"
    android:layout_height="match_parent" 
    android:layout_below="@id/radio">
  <android.support.v7.widget.AppCompatRadioButton
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:text="@string/abc_capital_on"/>
  <android.support.v7.widget.AppCompatRadioButton
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
    android:text="@string/abc_capital_off"/>
  </RadioGroup>

it works fine for some themes, we have inherited different style in our application. this issue happen only in some specific theme. not understand the exact cause.

Can anyone aware of exact root cause for this?

Best Answer

Answers

  • LeonLuLeonLu Member, Xamarin Team Xamurai
    edited October 11

    If you change the custom theme's parent like following code, If it could show correctly. Please make sure this android:Theme is correct.

      <style name="MyTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
         <item name="android:windowIsTranslucent">true</item>
         <item name="android:windowBackground">@color/colorPrimaryDark</item>
         <item name="android:windowContentOverlay">@null</item>
         <item name="android:windowNoTitle">true </item>
         <item name="android:backgroundDimEnabled">false</item>
       </style>
    

    Root case may related to the your AppCompatRadioButton cannot be applyed for the style of android:Theme, and the AppCompatRadioButton is added in the version 25.1.0, If you use it in the Android 4.4 and with custom style, please use RadioButton not used AppCompatRadioButton

  • @LeonLu , thanks for your answer, but the thing is, we are using different styles in my different application. So i need exact reason for why the radio button not shows while using some themes, it will help full for us.

  • saravananMadheswaransaravananMadheswaran Member ✭✭
    edited October 11

    it affected with different themes

    @LeonLu see the image with noactionbar theme.

Sign In or Register to comment.