首页 > 解决方案 > 使用shell时如何更改iOS中状态栏的颜色

问题描述

我正在使用Xamarin Forms v4.0.0.425677. 当我使用 shell 时,我将 BackgroundColor 设置为#ff3A2E,它在 iOs 中不起作用。

<code>
public AppShell()
{
    InitializeComponent();
    SetTabBarBackgroundColor(this, Color.FromHex("#D9D9D9"));
    SetTabBarTitleColor(this, Color.FromHex("#FF3A2E"));
    SetTabBarUnselectedColor(this, Color.FromHex("#FF3A2E"));
    SetBackgroundColor(this, Color.FromHex("#FF3A2E"));
}
</code>

看起来有一个覆盖层。

标签: c#iosxamarinxamarin.forms

解决方案


对于 iOS,您可以尝试编辑Info.plist文件的键,它们可能如下所示:

<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>

推荐阅读