objective-c - 安装 ipa 的人不会出现标题

标签 objective-c ios

我在 CustomTabBarViewController 中设置标题

@implementation UINavigationBar (UINavigationBarCategory)
- (void)drawRect:(CGRect)rect {
    CGContextRef context=UIGraphicsGetCurrentContext();

    CGContextTranslateCTM(context, 0.0, self.bounds.size.height);
    CGContextScaleCTM(context, 1.0, -1.0);
    CGContextDrawImage(context, self.bounds , [UIImage imageNamed:@"capiton_haut.png"].CGImage);

    if(UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation]))
    {
        CGContextDrawImage(context, CGRectMake(155, 5, 170, 37), [UIImage imageNamed:@"logo_pages.png"].CGImage);
    }
    else {
        CGContextDrawImage(context, CGRectMake(75, 5, 170, 37), [UIImage imageNamed:@"logo_pages.png"].CGImage);
    }
}
@end

@implementation CustomTabBarViewController.....

当我测试时,我看到了标题。在我提交并将 ipa 发送给测试人员后,他们没有错误,但看不到 header 。是黑色的。

谢谢, 拉卢卡

最佳答案

图像在 IPA 内吗?您好像忘记了,或者名称与“capiton_haut.png”不同。

编辑:

不使用类别,而是创建 UINavigationBar 子类来覆盖 drawRect: 方法。这应该可以解决您的问题,并且可以在 iOS 5 上运行。

关于objective-c - 安装 ipa 的人不会出现标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9580541/

相关文章:

iOS - 如何在用户拖动时触摸的线上绘制点

ios - 等到对象可用

ios - 从 'int *' 分配到 'int' 的指针转换不兼容的整数

ios - objectWithID : versus existingObjectWithID: 之间无法解释的行为差异

ios - Swift 中的通用类继承

objective-c - 如何从 cocoa 应用程序运行 Rails 命令?

ios - 打开应用程序商店页面来评价我的应用程序

ios - 我们如何使用 iOS 中的应用程序读取传入的短信

ios - objective c 将特殊 URL 转换为 NSURL

ios - 如何检查为iOS编译的目标文件的arm版本?