gpt4 book ai didi

xamarin - 无法更改导航栏背景颜色 Xamarin 表单

转载 作者:行者123 更新时间:2023-12-02 16:59:51 25 4
gpt4 key购买 nike

我已经尝试更改导航栏背景颜色,但它不起作用。

<ResourceDictionary>
<Style TargetType="NavigationPage">
<Setter Property="BarBackgroundColor" Value="#6eb43a"/>
<Setter Property="BackgroundColor" Value="#6eb43a"/>
</Style>
</ResourceDictionary>

BarBackgroundColor = 不工作BackgroundColor=工作

所以当我使用 BackgroundColor 时(问题是它也会更改背景颜色)然后它会影响导航背景但 BarBackgroundColor 不起作用。是否有任何解决方案可以全局更改 BarBackground Color 以影响整个项目?

最佳答案

对于那些使用新的 Xamarin.Forms.Shell 布局的用户,您可以通过直接在 Shell 节点上设置背景颜色来实现此目的

<Shell BackgroundColor="#FFFFFF">...

然后这将沿着层次结构向下流动,您可以根据需要在子节点上覆盖它。

关于xamarin - 无法更改导航栏背景颜色 Xamarin 表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54592278/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com