Objective c 对于安装ipa的用户,不会显示标题

Objective c 对于安装ipa的用户,不会显示标题,objective-c,ios,Objective C,Ios,我在CustomTabBarViewController中设置了标题 @implementation UINavigationBar (UINavigationBarCategory) - (void)drawRect:(CGRect)rect { CGContextRef context=UIGraphicsGetCurrentContext(); CGContextTranslateCTM(context, 0.0, self.bounds.size.height);

我在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发送给测试人员后,他们没有bug,但看不到标题。它是黑色的

谢谢,
Raluca

图像是否在IPA内?好像你忘了,或者名字和“capiton_haut.png”不一样

编辑:


不要使用category,而是创建一个UINavigationBar子类来覆盖
drawRect:
方法。这将解决您的问题,并在iOS 5上运行。

我以前遇到过此类问题,请检查“capiton\u haut.png”的拼写是否正确,因为模拟器不区分大小写,但设备可能会区分大小写

胡乱猜测:应该是
capTIon\u haut
,而不是
capITon\u haut
。或者该图像不在项目中。与模拟器不同,设备区分大小写。检查您的图像名称是否有大写字母。它没有大写字母。拼写正确。如何验证?是否在ipa内?为什么不应该呢?我的手机看起来不错。我在档案中找到了这些图像。我不明白…可能是因为手机测试仪?当我在arhive中查看图像时,我看到了它们,但如果我打开它们,它们似乎是空的…这是因为Xcode在应用程序构建时“压缩”了您的图像。为了节省空间,我还应该做什么?