Xamarin.Forms RadioButtons Text Not Visible

折月煮酒 提交于 2020-12-21 04:11:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!