Open
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
- Create a
RadioButton
- Try setting the properties listed above
For example
<RadioButton
x:Name="BuggedRadioButton"
TextColor="Red"
FontSize="50"
TextTransform="Uppercase"
FontAttributes="Bold"
Content="Hello, world!" />
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