【问题标题】:Is there a way to change the color of the Apple information and the slider bar at the top and bottom of an iOS screen?有没有办法改变 iOS 屏幕顶部和底部的 Apple 信息和滑块的颜色?
【发布时间】:2019-02-20 23:25:16
【问题描述】:

我有一个具有暗模式的表单应用程序。然而,出现在显示屏顶部的 Apple 信息以及底部的滑块看起来非常亮。有没有办法改变这些的颜色?

【问题讨论】:

    标签: xamarin xamarin.forms


    【解决方案1】:

    顶部栏只能是黑色或白色,或者如果您根本不想看到它,可以隐藏它。

    底部(标签)栏,可以被影响,你可以在 iOS 上使用 Appearance APIs。例如,在您的 AppDelegate.cs 文件中添加这样的一行:UITabBar.Appearance.TintColor = Color.Red.ToUIColor();

    可能还有更高级的场景,请在此处查看我的博客文章:https://blog.verslu.is/xamarin/xamarin-forms-xamarin/spicing-up-your-xamarin-formsios-tabbar/

    以及 Xamarin.Forms 存储库上的(开放)PR,这将直接从 Forms 框架中实现这一点:https://github.com/xamarin/Xamarin.Forms/pull/4899

    【讨论】:

      【解决方案2】:

      在应用程序 delegates.cs 中找到 Finishlaunching 方法和所有以下代码。也相应地设置颜色。

      UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB(190, 18, 40); UINavigationBar.Appearance.SetTitleTextAttributes(新 UITextAttributes { TextColor = UIColor.Blue});

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-05-16
        • 2023-04-04
        • 1970-01-01
        • 2012-03-17
        • 1970-01-01
        • 2021-05-27
        • 2021-03-30
        • 1970-01-01
        相关资源
        最近更新 更多