在你要写navigation bar的m文件前面放一段这个:
@interface UINavigationBar (MyCustomNavBar) @end @implementation UINavigationBar (MyCustomNavBar) - (void) drawRect:(CGRect)rect { UIImage *barImage = [UIImage imageNamed:@"xxxxx.png"]; [barImage drawInRect:rect];
@end
|
本文介绍了一种在iOS应用中自定义UINavigationBar背景的方法。通过创建UINavigationBar的类别,可以在导航栏中显示自定义图片作为背景,提供一种简单有效的方式实现导航栏个性化。
3513

被折叠的 条评论
为什么被折叠?



