maui
maui copied to clipboard
RadioButton: TextColor for plain Content not working on iOS
Description
I have a simple RadioButton on a page:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiRadio8.MainPage">
<ScrollView>
<VerticalStackLayout
HorizontalOptions="Center"
VerticalOptions="Center"
Background="Green">
<RadioButton
Content="White"
Value="1"
TextColor="White" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>
On iOS the TextColor is not taken into account:
On WinUI for example the text appears correctly in white:
Steps to Reproduce
- Create a new MAUI app from template
- Add the above xml in the
MainPage.xaml
Link to public reproduction project repository
https://github.com/marco-skizza/MauiRadioButtonTextColor
Version with bug
8.0.0-rc.2.9373
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
Tested on iPad mini 6, iPadOS 16.7.1
Did you find any workaround?
Even though not so nice, it can be fixed with custom Content:
<RadioButton
Value="1">
<RadioButton.Content>
<Label TextColor="White">White</Label>
</RadioButton.Content>
</RadioButton>
Relevant log output
No response
Verified this on Visual Studio Enterprise 17.8.0 Preview 3.0(8.0.0-rc.2.9373). Repro on iOS 16.4, not repro on Windows 11 and Android 13.0-API33 with below Project: 18011.zip
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.
Looks like this was fixed when I tested it on the latest in main:
Thanks @dustin-wojciechowski
With today's nightly build 8.0.60-ci.net8.24272.1 I still experience the issue.
But I don't know how you handle the merging of your main, so I'll check back when 8.0.60 is officially out.
Or do you mean it'll be fixed with v9?
@marco-skizza The nightly builds should reflect what's in main. I tested it again on IPad 16.4 and seems like it's working:
I just copy pasted the code you had in your description into our "Sandbox" project that allows us to more easily test things. Do you perhaps have any workarounds in place or something that would conflict with this? If it's another issue, such as with Control Template, we can possibly link that to some open issues we're currently investigating.
Hi @dustin-wojciechowski
I created a sample project with which I still experience the issue on 8.0.60-ci.net8.24274.1:
https://github.com/marco-skizza/MauiRadioButtonTextColor
Besides, I'm now on:
- Visual Studio 17.10.0
- Xcode 15.2
- Device: iPad mini 6 with iPadOS 17.3.1
Hmm, now that I've imported your project directly I receive the same behavior. I'm wondering if this is related to an issue we're having with RadioButton and Control Templates... I'll reopen this in the meanwhile while we continue investigation.
It works for me with the code from the @marco-skizza repo
<VerticalStackLayout
HorizontalOptions="Center"
VerticalOptions="Center"
Background="Green">
<RadioButton
Content="White"
Value="1"
TextColor="White" />
</VerticalStackLayout>
Hi
It still doesn't work for me with the code from my repo (see on top of page). I wonder what you are doing different than me...?
Besides, I'm now on:
- .NET MAUI: 8.0.70-ci.net8.24312.3
- Visual Studio 17.10.2
- Xcode 15.4
- Device: iPad mini 6 with iPadOS 17.5.1
@marco-skizza maybe try to remove explicit styles applied to RadioButton in Styles.xaml
@kubaflo Thanks for the hint. But I already have a workaround in place (see original post). This issue is more for other people, trying to set the text color of the radio button in an new/untouched project.
@marco-skizza maybe try to remove explicit styles applied to RadioButton in Styles.xaml
I commented out the Style for RadioButton, but this is still an issue for me on .NET MAUI: 8.0.70-ci.net8.24312.3.
I have the same issue on MauiVersion 8.0.90