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

标签 ios ipad uipopovercontroller

我在 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/

相关文章:

ios - 弹出 View 为空白

html - iPad、Safari、CSS : Fill page with flex

ios - 如何以编程方式截取可扩展uitableview的屏幕截图

ipad - 从模态视图 Controller 呈现弹出框

objective-c - ABRecordCopyValue() EXC_BAD_ACCESS 错误

ios - 在 UITableView 中点击已选定的单元格时,将调用 willSelectCellAtIndexPath

Xcode 3.2.4 代码感知不适用于 UIPopoverController

ios - 更改 UIPopoverController 颜色(和后退按钮颜色)

ios - 核心数据 : What difference between insertNewObject vs designated initializer

ios - 日期格式如 "Monday, December 10"在 ios 5.1 中错误显示