English 中文(简体)
切开控制器的本地发型功能不正常
原标题:Local styling of Switch Control is not working properly
  • 时间:2024-05-16 00:03:53
  •  标签:
  • maui

据我了解,本地型号具有优先。 但出于某种原因, App 级别的默认模板似乎压倒了本地风格。 例如, 设置本地属性不起作用或被推翻 :

<Switch OnColor="Orange" ThumbColor="Green" />

添加页面级别资源样式效果也不好 :

<ContentPage.Resources>
    <Style TargetType="Switch">
        <Setter Property="OnColor" Value="Blue"  />
        <Setter Property="ThumbColor" Value="Red" />
    </Style>
</ContentPage.Resources>

<Switch />

仅在对应用程序级别上 进行评论时,上述样式才有效。

会不会是虫子? 还是我漏掉了什么?

问题回答

是的,我可以确认它在.NET 8 上存在一个潜在的问题,它与> Switch control忽略了“Color”和“缩略图Color” #19380 。幸运的是,它正在运行 .NET 7

作为一种变通办法,您可以通过评论 来修正它,如您在文章中所说,或者您可以使用一个 CustomSwitchHandler ,它使用来自Switch 。关于更多细节,您可以参考 > 提供的解决办法





相关问题
Unable to access file in ResourcesSounds folder

I m using .net Maui and attempting to create audioManager players for a couple of sound files located in the ResourcesSounds folder in the project. The code is this: var playerStartSound = ...

.NET MAUI native audio player

I am interested is there a way to play mp3 files from the phone internal memory using the built in native audio player. I am asking this, because I want to implement an equalizer too, so I am guessing ...

Integrating Push Notifications in MAUI .NET 7 Applications

I m developing a cross-platform application using MAUI .NET 7 and I would like to add push notification functionality to my application. I m considering using Firebase Cloud Messaging or Azure ...

Databinding doesnt work in my xaml.cs file

I am trying to load some data from my Model to the xaml.cs file. But it doesn t work. In my Mainpage.xaml i have a binding property inside a label. In the code behind file a BindingContext to my ...

Do some tasks after OnAppearing() in MAUI

I have a maui community toolkit expander control in my page. On Tapping the header the content is shown/hidden .I got a Maui map in the expander s content. It display properly if the expander is in ...

NET MAUI是否有可调整的分辨率特征?

页: 1 NET MAUI用于一个即将到来的项目,但我发现一件失踪的事情是,我需要的是分裂的特征。 我发现,散射器在移动上可能不会产生作用,但Im主要针对Windows......。

How to optimize detail page reset button in C# MAUI?

I ve implemented a Reset button on a Detail page in C# MAUI and it works, but I can t figure out why I need to be so explicit in the way I capture the initial data to perform the reset, when requested....

热门标签