-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] RadioButton not displaying text on Android #11700
Comments
Closing for now. RadioButton is going through a major change on 5.0.0 |
Oh well...at least there an easy workaround till then - put the RadioButton in a horizontal stack panel along with a label, and optionally add a TapGestureRecognizer to the label so tapping it also sets the radio button value. |
@kamalkumar1 The radio button works for me, but does not display a label under Android. So I simply put it in a StackPanel with a normal label and added a TapGestureRecognizer to the label, so that tapping it will check the radio button.
|
Please don't make anything new, just fix the existing functionality. PLEASE! |
so we expect breaking changes every time this make development experience unpleasing cuz when u update to latest version your not sure what will work and what will not work so its a tiresome |
@Munde when you use Microsoft products for a long time you get used to it that it breaks something with every release. But yea it's super annoying for a development framework to break multiple things with each release without even fixing all the old releases... |
Quick Workaround for the problem:
Yes, I know this increases the VisualTree. Yes, I also know that this requires the ViewModel to reference the RadioButton and do the IsChecked toggle. It's not a clean good solution but at least it is working.. |
I found this problem too. It's so confusing and tired as a new Xamarin-learner. |
@hopeko just get used to it, they do it on a regular basis to break stuff on updates. :D |
@Sebastian1989101 I used another way arround using tapGestures but all in all its unpleasant developer experience since i wasted almost 2 hours at first looking for what waswrong withmy code, also on upcoming version there are lot to come on breaking changes am using c# for makeup n we are told its being kicked of xamarin forms so its a trade off to stay with either xf 4.8 or move to 5 when its available there us no smoth transition |
This is an interesting bug to be introduced in Xamarin Forms 4.8 if changes that go in completely different direction are being merged in Forms 5.0. It seems odd for 4.8 to completely break on Android if the other ticket is going to be changing things in 5.0. |
For Xamarin dev team, no big deal to broke something, but fixing it took a long time. Question, what a hell are you doing??? |
@samhouts Maybe, it will be easy to fix this bug, not closing it. Whole month you didn't do nothing. |
Aarrrggghhhh, just been wasting my time on this one. Lucky I came across it before we accidentally released with this. Frustrating. |
Try input control availble in nuget packge.
Regard
*Kamalkumar.E*
Senior Mobile Application Developer
Mobile:+91-9750461689
Skype:kamalelango15
<https://www.linkedin.com/in/kamal-kumar-39450654/>
…On Sat, Oct 3, 2020 at 3:57 PM RhomGit ***@***.***> wrote:
Aarrrggghhhh, just been wasting my time on this one. Lucky I came across
it before we accidentally released with this.
I'll try replacing all of our RadioButtons with the ridiculous
StackLayout/OnPlatform/TapGesture/Label workaround, thanks
@Sebastian1989101 <https://github.com/Sebastian1989101>
Frustrating.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11700 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXDAFFNT5VOZUS734J47FLSI337NANCNFSM4PYQFOPA>
.
|
Wtf @PureWeen what do you mean close this for now?? It's literally completely broken and a regression bug. What a fucking joke. Experimental does not mean 'non working'. I'm going back to 4.7 |
Whilst I don't agree with the language I do agree that this has been extremely inconvenient and pretty poor form. More issues have arisen recently in our latest production build because of this. Now we need to prepare another build because data entry elements of the UI being unusable. My fault really, we generate some UI elements in code not XAML which I missed when doing the original StackLayout/OnPlatform/TapGesture/Label workaround. I probably won't bother using experimental features again. |
I have downloaded XF 5.0 and there is no Text property in RadioButton. |
Maybe, just maybe because it has now a Content which can hold everything. See: https://youtu.be/ttF80UnrJAg?t=364 |
Switching to https://github.com/enisn/Xamarin.Forms.InputKit I understand the feature was experimental - the issue should not be closed. Radios without labels is a big problem and just closing it does not leave me with much of any confidence. |
Thanks. I will check this. |
I cannot speak to its reliability, but I was able to work around this issue with a custom renderer. using Android.Content;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(RadioButton), typeof(ProjectName.Droid.Renderers.PatchedRadioButtonRenderer))]
namespace ProjectName.Droid.Renderers
{
/// <summary>
/// A workaround for the issue in the in-box renderer.
/// https://github.com/xamarin/Xamarin.Forms/issues/11700
/// </summary>
public class PatchedRadioButtonRenderer : RadioButtonRenderer
{
public PatchedRadioButtonRenderer(Context context) : base(context) {}
protected override void OnElementChanged(ElementChangedEventArgs<Button> e)
{
// Apply text to native radio button
this.Control.Text = e.NewElement.Text;
base.OnElementChanged(e);
}
}
} |
@IgorKravchenko10 there is value i thing replace the text |
Classic Xamarin! |
yep, experiencing this now. no text displaying to radiobutton |
Here is a nice Style I created in case anyone wants it: <Style x:Key="RadioButtonStyle" TargetType="RadioButton"> </Style>This gave a very basic standard Radio Button. You can obviously modify it any way that is appropriate for you. |
Description
After updating to Xamarin.Forms 4.8, radio buttons no longer display their text under Android. Same code works under 4.7.
Steps to Reproduce
<RadioButton Margin="5" Text="Test" />
Expected Behavior
The radio button displays the text "Test" to the right.
Actual Behavior
Only the circle of the radio button is displayed, with no text.
Basic Information
Screenshots
The text was updated successfully, but these errors were encountered: