Skip to content

[iOS] RadioButton text related properties not working #19081

Open
@riccardominato

Description

Description

Some of the properties related to the text style of RadioButton seem to have no effects on iOS.

Those I'm aware of are:

  • TextColor
  • FontSize
  • FontAttributes

Steps to Reproduce

  1. Create a RadioButton
  2. Try setting the properties listed above

For example

<RadioButton
    x:Name="BuggedRadioButton"
    TextColor="Red"
    FontSize="50"
    TextTransform="Uppercase"
    FontAttributes="Bold"
    Content="Hello, world!" />

Actual result
Screenshot 2023-11-28 alle 16 35 20

Expected result
Screenshot 2023-11-28 alle 16 36 38

Link to public reproduction project repository

https://github.com/Riccardo11/MauiIssues/tree/main/RadioButtonText

Version with bug

8.0.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

iOS supports using a View object for its Content property, so you can use a Label that will be styled.

#if IOS
BuggedRadioButton.Content = new Label
{
    Text = "Hello, world!",
    TextColor = Colors.Red,
    FontSize = 50,
    TextTransform = TextTransform.Uppercase,
    FontAttributes = FontAttributes.Bold
};
#endif

but doing this cause some warning logs stating that iOS doesn't support a View as Content, even though the documentation says the opposite.

Relevant log output

Microsoft.Maui.Controls.RadioButton: Warning: Warning - iOS does not support View as the Content property of RadioButton; the return value of the ToString() method will be displayed instead.
Microsoft.Maui.Controls.RadioButton: Warning: Warning - iOS does not support View as the Content property of RadioButton; the return value of the ToString() method will be displayed instead.
Microsoft.Maui.Controls.RadioButton: Warning: Warning - iOS does not support View as the Content property of RadioButton; the return value of the ToString() method will be displayed instead.
Microsoft.Maui.Controls.RadioButton: Warning: Warning - iOS does not support View as the Content property of RadioButton; the return value of the ToString() method will be displayed instead.
Microsoft.Maui.Controls.RadioButton: Warning: Warning - iOS does not support View as the Content property of RadioButton; the return value of the ToString() method will be displayed instead.
Microsoft.Maui.Controls.RadioButton: Warning: Warning - iOS does not support View as the Content property of RadioButton; the return value of the ToString() method will be displayed instead.
Microsoft.Maui.Controls.RadioButton: Warning: Warning - iOS does not support View as the Content property of RadioButton; the return value of the ToString() method will be displayed instead.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions