如何自定义 EKEventEditViewController?
我正在使用 EKEventEditViewController 将事件添加到日历中,但是我需要自定义表视图,例如背景颜色和单元格属性。
我尝试像这样循环遍历它的子视图,但没有成功。
失败代码:
EKEventEditViewController *eventVc = [[EKEventEditViewController alloc] init];
eventVc.event = event;
eventVc.delegate = self;
eventVc.eventStore = eventStore;
eventVc.editViewDelegate = self;
for (UITableView *view in [eventVc.view subviews]) {
[view setBackgroundColor:[UIColor redColor]];
}
[self presentModalViewController:eventVc animated:YES];
I am using the EKEventEditViewController to add events to the calendar, however I need to customise the table view, such as background colour and cell properties.
I have tried looping through its subviews like so with no luck.
Failed code:
EKEventEditViewController *eventVc = [[EKEventEditViewController alloc] init];
eventVc.event = event;
eventVc.delegate = self;
eventVc.eventStore = eventStore;
eventVc.editViewDelegate = self;
for (UITableView *view in [eventVc.view subviews]) {
[view setBackgroundColor:[UIColor redColor]];
}
[self presentModalViewController:eventVc animated:YES];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
UINavigationController
委托方法来自定义EKEventEditViewController
。看看这个https://stackoverflow.com/a/17469491/1305001
you can use
UINavigationController
delegate method to customizeEKEventEditViewController
.Have a look at this https://stackoverflow.com/a/17469491/1305001
对此没有简单的解决方案,但我最终创建了一个自定义视图控制器,从中手动处理所有事件数据。
There hasn't been a simple solution to this, but I ended up creating a custom view controller from which I handled all the event data manually.