Menu
Who Do Is
  • Home
  • What
  • How
  • Is
  • Can
  • Are
  • Does
  • Do
  • Why
  • Who
  • Where
  • Which
  • Which
  • Should
  • Will
  • When
  • What’s
  • Did
Who Do Is

[ANSWERED] xamarin – RadioButton not visible on Android 10/11 with light theme

Posted on November 14, 2022

Solution 1 :

While Xamarin.Fomrs dev team working on this issue you can apply the following workaround, in Android styles.xml set the following attribute:

<item name="android:colorControlNormal">#FF4081</item>

which will set a color to the RadioButton circle.

Problem :

We are using the new experimental radio button in Xamarin Forms:
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/radiobutton

Xamarin.Forms version – 4.8.0.1269

The radio buttons work perfectly in Android 9 and lower devices.
But on Android 10/11, if the phone theme is set to Light theme, the Radio button icon goes missing.
Here are the sample screenshots from both dark and light themes respectively:

Dark theme on emulator

Light theme on Samsung device

And here is the code written for the radio buttons:

                    <StackLayout VerticalOptions="Start" 
                                 HorizontalOptions="FillAndExpand">

                        <Label Text="Body temperature"
                               Style="{StaticResource BlackBoldLabelStyle}"
                               VerticalOptions="Start"
                               HorizontalOptions="StartAndExpand" />

                        <StackLayout VerticalOptions="Start" 
                                     Margin="0,10,0,0"
                                     HorizontalOptions="FillAndExpand"
                                     Orientation="Horizontal">
                            <StackLayout.GestureRecognizers>
                                <TapGestureRecognizer Command="{Binding OnBodyTempOption1Click}"/>
                            </StackLayout.GestureRecognizers>

                            <RadioButton
                                   HorizontalOptions="Start"
                                   VerticalOptions="Center" 
                                   IsChecked="{Binding IsBodyTempOption1Check}"/>

                            <Label Text="Less than 99.5 degree F / 37.5 degree C"
                                   VerticalOptions="Center"
                                   Style="{StaticResource DarkGrayLabelStyle}"
                                   HorizontalOptions="StartAndExpand" />
                        </StackLayout>

                        <StackLayout VerticalOptions="Start" 
                                     Margin="0,5,0,0"
                                     HorizontalOptions="FillAndExpand"
                                     Orientation="Horizontal">
                            <StackLayout.GestureRecognizers>
                                <TapGestureRecognizer Command="{Binding OnBodyTempOption2Click}"/>
                            </StackLayout.GestureRecognizers>

                            <RadioButton
                                   HorizontalOptions="Start"
                                   VerticalOptions="Center" 
                                IsChecked="{Binding IsBodyTempOption2Check}"/>

                            <Label Text="More than 99 degree F / 37 degree C"
                               VerticalOptions="Center"
                                   Style="{StaticResource DarkGrayLabelStyle}"
                               HorizontalOptions="StartAndExpand" />
                        </StackLayout>
                    </StackLayout>

Please help on how to fix the issue with the radio button visibility.

Comments

Comment posted by nevermore

I did not reproduce the problem on my side while I get an other problem. Does it work in a lower Xamarin.forms version? RadioButton is currently experimental and you can report this problem in Github.

Comment posted by nevermore

OK, once you find a solution, you can also share here.

Comment posted by github.com/xamarin/Xamarin.Forms/issues/11700

There are currently known issues with Radio Button & Android platform with the release of Xamarin Forms 4.8.

READ  [ANSWERED] performance - Android Viewpager Fragment Network Call handling
Powered by Inline Related Posts

Comment posted by Cfun

Could you give a feedback if this issue is still reproducible or no?

Comment posted by manishKungwani

@Cfun It was due to the light/dark theme.

Comment posted by Thamarai T

For Xamarin.Forms version 5.0.0.2012, this issue exists.

Comment posted by Thamarai T

this workaround adds the tint color to all editable controls.

Recent Posts

  • How can I play with my cat without toys?
  • What is a bag pipe band called?
  • Are Honda Civics actually fast?
  • Are Yankee candles toxic?
  • How do I pair my Michael Kors smartwatch with my Android?

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuántas
  • ¿Cuánto
  • ¿Que
  • ¿Quién
  • 90” and 108” so you may have to round up to the nearest size.
  • and delete any Spotify folders from it. Once this is done
  • Android
  • Are
  • At
  • Bei
  • blink
  • C'est
  • Can
  • carbs
  • Comment
  • Did
  • Do
  • Does
  • During
  • For
  • Has
  • How
  • In
  • Is
  • Ist
  • Kann
  • Können
  • nouveau
  • On
  • or 108 inches.2020-08-03
  • Où
  • owning
  • Pourquoi
  • Puis-je
  • Quand
  • Quante
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • spiritual
  • tap the downward-facing arrow on the top left. A downward-facing arrow will appear underneath each song in the album; they'll turn green as the download completes.2020-07-28
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welcher
  • Welches
  • Welke
  • Wer
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Whose
  • Why
  • Wie
  • Will
  • Wo
  • Woher
  • you will receive two curtains each with the same measurements of width 66"" (168cm) x drop 54""(137cm).
  • you'll see a green downward-facing arrow next to each song.2021-02-26
©2023 Who Do Is | Powered by SuperbThemes & WordPress