问题
I'm using the experimental radio buttons in Xamarin.Forms
, everything was working fine but suddenly the radio buttons text stopped appearing.
public RequestsPage()
{
InitializeComponent();
Device.SetFlags(new string[] { "RadioButton_Experimental" }); // to be able to use radio buttons
}
回答1:
There was a bug introduced in version 4.8.0 causing the RadioButton
text not to show, fortounately this was fixed starting from version 5.0.0 pre-1 and higher.
In your Nuget Package manager check the "include pre realeases" option and select 5.0.0 pre-1 or the latest. You can also roll back by selecting a previous working version before the bug was introduced if you prefere.
If you choosed to update you may need to change your target platform version.
If you encounter some compilation errors then change your RadioButton
syntax from:
<RadioButton Text="click"/>
To
<RadioButton Content="click"/>
If you want to stick with your current xf version, then take a look at this sugessted workaround
EDIT
Starting from Xamarin.Forms version 5.0.0.1539-pre2 experimental flag for RadioButton
has been dropped (no longer needed) and is considered stable by the dev team.
来源:https://stackoverflow.com/questions/64759079/xamarin-forms-radiobuttons-text-not-visible