Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何自定义EKEventEditViewController?_Iphone_Objective C_Ipad_Ekeventkit - Fatal编程技术网

Iphone 如何自定义EKEventEditViewController?

Iphone 如何自定义EKEventEditViewController?,iphone,objective-c,ipad,ekeventkit,Iphone,Objective C,Ipad,Ekeventkit,我正在使用EKEventEditViewController将事件添加到日历中,但是我需要自定义表格视图,例如背景颜色和单元格属性 我尝试过像这样循环遍历它的子视图,但没有成功 失败代码: EKEventEditViewController *eventVc = [[EKEventEditViewController alloc] init]; eventVc.event = event; eventVc.delegate = self; eventVc.eventSto

我正在使用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];

没有简单的解决方案,但我最终创建了一个自定义视图控制器,从中手动处理所有事件数据。

您可以使用
UINavigationController
委托方法自定义
EKEventEditViewController

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
    if ([viewController isKindOfClass:[UITableViewController class]]) {

        UITableView *tblView=((UITableViewController*)viewController).tableView;

        [tblView setBackgroundColor:[UIColor redColor]];
        [tblView setBackgroundView:nil];
    }
}

看看这个

Hii Josh,请详细说明如何手动处理事件数据,我还想自定义EKEventEditViewController,我想再添加两个字段并删除一个URL字段,我该怎么做。。请帮帮我。