【发布时间】:2013-02-11 13:20:39
【问题描述】:
我在我的 appdelegate 中设置了一个自定义导航栏。您可以在此处查看代码。
UIImage *image = [UIImage imageNamed:@"navbar.png"];
[[UINavigationBar appearance] setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
但现在我正在使用 eventkit 框架。我想要的是当我去事件详细信息时,我得到标准的导航栏布局。所以没有图像。
EKEventViewController *vc = [[EKEventViewController alloc] init];
[vc.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
vc.event = [dataSource eventAtIndexPath:indexPath];
vc.allowsEditing = YES;
[calendar.navigationController pushViewController:vc animated:YES];
我尝试了以下方法,但它不起作用。 有什么帮助吗?
【问题讨论】:
-
您是否尝试将 [vc.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault] 命令放入 EKEventViewController 类本身的 viewWillAppear 中?
-
您无法访问该课程?这是 eventKit 框架内的一个类
-
怎么不工作了?图像没有变化吗?
-
不,图像没有改变。
标签: iphone ios objective-c uinavigationcontroller