Skip to content

[regression/8.0.0-rc.1.9171] Unable to set Button TextColor #17413

@imsam67

Description

@imsam67

Description

No matter what I do, I can't seem to set the TextColor for Button on iOS. Also, compared to .NET 7, FontSize seems over sized -- see comparison screenshot below.

I first started experiencing this with .NET 8 Preview 7. If I switch back to targeting .NET 7, everything goes back to normal.

I set the Button sytling in Styles.xaml which looks like this:

<Style TargetType="Button">
    <Setter Property="TextColor" Value="{StaticResource White}" />
    <Setter Property="TextTransform" Value="Uppercase" />
    <Setter Property="BackgroundColor" Value="{StaticResource UIGraphite}" />
    <Setter Property="FontFamily" Value="OpenSansRegular" />
    <Setter Property="FontSize" Value="10" />
    <Setter Property="FontAttributes" Value="Bold" />
    <Setter Property="CharacterSpacing" Value="1.5" />
    <Setter Property="CornerRadius" Value="12" />
    <Setter Property="Padding" Value="20,2" />
    <Setter Property="Shadow.Brush" Value="{StaticResource Gray600Brush}" />
    <Setter Property="Shadow.Offset" Value="10,10" />
    <Setter Property="Shadow.Opacity" Value="0.6" />
    <Setter Property="HeightRequest" Value="25" />
</Style>

I also tried overriding these settings by specifying TextColor in the Button control to no avail.

F5ebHOybsAA0IgX

Steps to Reproduce

  1. Use the style I provided for Button control
  2. Target .NET 8 and run it
  3. Target .NET 7 and run it

Link to public reproduction project repository

No response

Version with bug

8.0.0-rc.1.9171

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

7.0.92

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

Haven't found a workaround yet

Relevant log output

No response

Metadata

Metadata

Labels

fixed-in-8.0.0-rc.2.9511Look for this fix in 8.0.0-rc.2.9511i/regressionThis issue described a confirmed regression on a currently supported versionplatform/iost/bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions