如何在 Xamarin App.Shell 中更改 Android ActionBar 颜色

问题描述

我正在使用 Xamarin 和 .netstandard 2.1 开发应用程序,但找不到更改 Android 应用程序操作栏的方法

enter image description here

蓝色条不是我想要的颜色,按照互联网上的所有文档和教程,我什至找到了一种更改状态栏(时钟、电池和通知所在的位置)的方法,但无法更改这个蓝色到橙色。

有人能告诉我我做错了什么吗?

谢谢

解决方法

BackgroundColor="Red" 级别全局设置附加属性 <Shell>

<Shell
       ...
       BackgroundColor="Red">

或者在 ContentPage 级别使用:

<ContentPage
       ...
       Shell.BackgroundColor="Red">

请注意,这将影响导航栏(您描述的那个)和上方的选项卡(TabBar)。

,

在您的 shell 应用 xaml 文件中,在顶部使用 Shell.BackgroundColor="Red"。

getopt