maui icon indicating copy to clipboard operation
maui copied to clipboard

RadioButton: TextColor for plain Content not working on iOS

Open marco-skizza opened this issue 2 years ago • 7 comments

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: MauiRadio8-iOS On WinUI for example the text appears correctly in white: MauiRadio8-WinUI

Steps to Reproduce

  1. Create a new MAUI app from template
  2. 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

marco-skizza avatar Oct 13 '23 14:10 marco-skizza

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

image

XamlTest avatar Oct 17 '23 07:10 XamlTest

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.

ghost avatar Oct 20 '23 12:10 ghost

Looks like this was fixed when I tested it on the latest in main:

simulator_screenshot_09BE77F5-378A-4D8C-841E-6A65749AC276

dustin-wojciechowski avatar May 20 '24 21:05 dustin-wojciechowski

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 avatar May 22 '24 06:05 marco-skizza

@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: simulator_screenshot_8A97BCC8-6199-4B9A-B668-05E7FFD5B611

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.

dustin-wojciechowski avatar May 23 '24 18:05 dustin-wojciechowski

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

IMG_0059

marco-skizza avatar May 24 '24 07:05 marco-skizza

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.

dustin-wojciechowski avatar May 24 '24 20:05 dustin-wojciechowski

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>

Simulator Screenshot - iPhone 15 Pro Max - 2024-06-09 at 11 28 48

kubaflo avatar Jun 09 '24 09:06 kubaflo

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 avatar Jun 12 '24 14:06 marco-skizza

@marco-skizza maybe try to remove explicit styles applied to RadioButton in Styles.xaml

kubaflo avatar Jun 12 '24 23:06 kubaflo

@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 avatar Jun 13 '24 16:06 marco-skizza

@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.

gktval avatar Jul 29 '24 18:07 gktval

I have the same issue on MauiVersion 8.0.90

t-macintosh avatar Nov 06 '24 00:11 t-macintosh