gpt4 book ai didi

ios - 如何摆脱 iOS 4 中 UIPopoverController 中奇怪的黑色导航栏

转载 作者:行者123 更新时间:2023-11-29 04:39:07 24 4
gpt4 key购买 nike

我在 iPad 应用程序中使用弹出框 Controller 。在 iOS 5 中,弹出窗口如下所示:

enter image description here

在 iOS 4 中,它看起来像这样:

enter image description here

如何摆脱这种奇怪的黑色背景?

更新:我很确定这是一个自伤,因为我公司生产的其他应用程序即使在 iOS 4 中运行也没有这种奇怪的黑色导航栏问题。我们必须在某处有代码可以改变这个背景,但我不确定如何做到这一点。

最佳答案

确实是自伤。如果有人感兴趣,此类别:

@implementation UINavigationBar (BackgroundImage)
- (void)drawRect:(CGRect)rect {

UIImage *image = [UIImage imageNamed: @"top-toolbar.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];

}
@end

...将允许您在 iOS 5 之前的版本中自定义导航栏,同时如果您忘记自己将其放在那里,也会让您抓狂。

关于ios - 如何摆脱 iOS 4 中 UIPopoverController 中奇怪的黑色导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10658394/

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