3

我使用以下代码查看事件。但导航栏不可见。

EKEventViewController *addController = [[EKEventViewController alloc] initWithNibName:nil bundle:nil];
addController.event = self.event;
addController.allowsEditing = YES;
addController.allowsCalendarPreview = YES;
[self.navigationController presentViewController:addController animated:YES completion:nil];
4

1 回答 1

2

使用 Present viewcontroller 您需要为 UIViewcontroller 添加单独的 NavigationController,例如:-

EKEventViewController *addController = [[EKEventViewController alloc] initWithNibName:@"EKEventViewController" bundle:nil];
UINavigationController *navController=[[UINavigationController alloc]initWithRootViewController:addController];
addController.event = self.event;
addController.allowsEditing = YES;
addController.allowsCalendarPreview = YES;


if ([self respondsToSelector:@selector(presentViewController:animated:completion:)])
    {
           [self presentViewController:navController animated:YES completion:nil];
    }
    else
    {

        [self presentModalViewController:navController animated:YES];
    }
于 2013-08-31T06:22:46.053 回答