Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting Label.FontSize at runtime does not do anything #6650

Closed
mattleibow opened this issue Apr 29, 2022 · 1 comment · Fixed by #6665
Closed

Setting Label.FontSize at runtime does not do anything #6650

mattleibow opened this issue Apr 29, 2022 · 1 comment · Fixed by #6665
Assignees
Labels
area-controls-label Label, Span fixed-in-6.0.300-rc.3 Look for this fix in 6.0.300-rc.3! p/0 Work that we can't release without platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@mattleibow
Copy link
Member

Description

Setting font size does not work.

Steps to Reproduce

<?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="Maui.Controls.Sample.MainPage">
    <StackLayout Padding="30" Spacing="20">

        <Label
            x:Name="myLabel"
            Text="Hello, World!"
            HorizontalOptions="Center"
            VerticalOptions="Center">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroupList>
                    <VisualStateGroup>
                        <VisualState x:Name="Normal">
                            <VisualState.StateTriggers>
                                <AdaptiveTrigger MinWindowWidth="500" />
                            </VisualState.StateTriggers>
                            <VisualState.Setters>
                                <Setter Property="Background" Value="Red" />
                                <Setter Property="FontSize" Value="48" />
                            </VisualState.Setters>
                        </VisualState>
                        <VisualState x:Name="Small">
                            <VisualState.StateTriggers>
                                <AdaptiveTrigger MinWindowHeight="0" MinWindowWidth="0" />
                            </VisualState.StateTriggers>
                            <VisualState.Setters>
                                <Setter Property="Background" Value="Green" />
                                <Setter Property="FontSize" Value="10" />
                            </VisualState.Setters>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateGroupList>
            </VisualStateManager.VisualStateGroups>
        </Label>

        <Button Text="Change Font Size"  Clicked="Button_Clicked" />

    </StackLayout>
</ContentPage>
using Microsoft.Maui.Controls;
using Microsoft.Maui.Handlers;

namespace Maui.Controls.Sample
{
	public partial class MainPage
	{
		public MainPage()
		{
			InitializeComponent();
		}

		void Button_Clicked(object sender, System.EventArgs e)
		{
			myLabel.FontSize += 10;
		}
	}
}

Version with bug

Release Candidate 2 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS, Other (Tizen, Linux, etc. not supported by Microsoft directly)

Affected platform versions

All

Did you find any workaround?

No.

Relevant log output

No response

@mattleibow mattleibow added t/bug Something isn't working s/needs-verification Indicates that this issue needs initial verification before further triage will happen legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor s/verified Verified / Reproducible Issue ready for Engineering Triage area-controls-label Label, Span and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Apr 29, 2022
@mattleibow mattleibow added this to the 6.0.300-rc.3 milestone Apr 29, 2022
@mattleibow mattleibow added the p/0 Work that we can't release without label Apr 29, 2022
@mattleibow mattleibow self-assigned this Apr 29, 2022
@mattleibow
Copy link
Member Author

Seems to have been accidentally removed - probably because we had no tests on this area :(

#5664

@ghost ghost locked as resolved and limited conversation to collaborators May 29, 2022
@samhouts samhouts added the fixed-in-6.0.300-rc.3 Look for this fix in 6.0.300-rc.3! label Feb 17, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-label Label, Span fixed-in-6.0.300-rc.3 Look for this fix in 6.0.300-rc.3! p/0 Work that we can't release without platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants