Skip to content

Conversation

HarishwaranVijayakumar
Copy link
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details

  • RadioButton TextColor not working on iOS when Label styles are present in Styles.xaml

Root Cause of the issue

  • The radio button uses contentpresenter to show the content. When the radio button content is string, the contentpresenter converter convert the string to label. When Label styles exist in the application, These styles automatically apply to All Label instances, including the one created by the ContentConverter

Description of Change

  • Changed the label creation in ConvertToLabel from using Label to a new subclass, ContentLabel, to ensure proper text color rendering for radio button content.
  • Added the ContentLabel class as a subclass of Label to support this change.
  • With this update, the label bypasses <Style TargetType="Label"> styles while retaining all the functionality of a standard Label.

Issues Fixed

Fixes #18011

Tested the behaviour in the following platforms

  • - Windows
  • - Android
  • - iOS
  • - Mac

Output

Before After

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Oct 9, 2025
Copy link
Contributor

Hey there @@HarishwaranVijayakumar! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Oct 9, 2025
@jsuarezruiz jsuarezruiz added area-controls-radiobutton RadioButton, RadioButtonGroup platform/ios labels Oct 9, 2025
}
}

class ContentLabel : Label { }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can include a comment here?

Internal label type used by ContentPresenter to avoid interference from global Label styles.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsuarezruiz, I have added a comment.

}

static Label ConvertToLabel(string textContent, ContentPresenter presenter)
static ContentLabel ConvertToLabel(string textContent, ContentPresenter presenter)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you include a related tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsuarezruiz, Tried to add test using Application.Current.Resources, but it breaks the other test cases.

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

Labels

area-controls-radiobutton RadioButton, RadioButtonGroup community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RadioButton: TextColor for plain Content not working on iOS

2 participants