gpt4 book ai didi

ios - 如何从 UINavigationBar 中删除背景图像

转载 作者:可可西里 更新时间:2023-11-01 05:42:15 24 4
gpt4 key购买 nike

我在 Root View Controller 中设置了 UINavigationBar 背景图像,但我需要在详细 View Controller 中删除背景图像。

对于 Obj-C,我使用这段代码:

if ([[UINavigationBar class] respondsToSelector:@selector(appearance)])  
{
[self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
}

所以当我在 MonoTouch 中使用这段代码时:

this.NavigationController.NavigationBar.SetBackgroundImage(null, UIBarMetrics.Default);

我收到这个错误:

System.ArgumentNullExeption  
Argument cannot be null
Parameter name: backgroundImage

如何删除背景图片?

最佳答案

这看起来像一个错误。此方法中应允许 AFAICT null 删除背景。

我将尽快为 MonoTouch 的下一个稳定版本修复此问题。如果这是阻塞,您只需在 http://bugzilla.xamarin.com 填写错误报告。我们将为您提供解决此问题的修补程序。

编辑:这是固定的,将在下一个版本中可用(例如 5.2.12 稳定版)

关于ios - 如何从 UINavigationBar 中删除背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10504966/

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