【发布时间】:2012-02-29 18:02:25
【问题描述】:
这是应用代理:
UINavigationController *moreController = _tbc.moreNavigationController;
moreController.navigationBar.tintColor = [UIColor blackColor];
UIImage *image = [UIImage imageNamed:@"navBar.png"];
[image drawInRect:rect];
/* UITableView *moreTableView = (UITableView *)moreController.topViewController.view;
// [moreTableView initWithFrame:CGRectZero style:UITableViewStyleGrouped];
[moreTableView setBackgroundColor:BACKGROUNDCOLOUR];*/
它只有在我改变背景颜色时才有效,但我怎样才能用图像替换背景?
[S O L V E D]
现在它的作品!
[moreController.navigationBar setBackgroundImage:[UIImage imageNamed: @"navBar.png"] forBarMetrics:UIBarMetricsDefault];
【问题讨论】:
-
在 SO stackoverflow.com/questions/7929987/… 上找到答案
-
非常感谢!现在可以了!!! [moreController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navBar.png"] forBarMetrics:UIBarMetricsDefault];
标签: ios background customization navigationcontroller navigationbar