2015-02-11 179 views
0

我已经在我的应用程序中实现了本机事件日历。我能够在显示屏幕截图中显示的日历下面通过使用下面的代码:如何设置iPhone日历取消和完成按钮的色调颜色

EKEventEditViewController *eventEditViewController = [[EKEventEditViewController alloc] init]; 
eventEditViewController.editViewDelegate = self; 
eventEditViewController.event = event; 
[self presentViewController:eventEditViewController animated:YES completion:nil];` 

不过,我不能够改变的取消和完成按钮的颜色。我如何更改日历的这些按钮的颜色?

enter image description here

回答

0

尝试设置您的导航控制器着色颜色

self.navigationController.navigationBar.tintColor = [UIColor redColor]; 

或自定义栏按钮项与所需的颜色?

+0

这不会起作用,视图控制器呈现在导航上,但它从来没有推过,所以它不知道它的父,换句话说navigationController它总是为零。 – 2015-04-21 16:34:41

0

您可以为您的所有导航控制器,例如色调的颜色:在AppDelegate中didFinishLaunchingWithOptions

[[UINavigationBar appearance] setTintColor:[UIColor redColor]];

1

在我的情况下,问题是navigationBar.barStyle。我将我的设置为UIBarStyleBlackOpaque,它使得白色按钮很好地显示出来。

nc = [[UINavigationController alloc]initWithRootViewController:eventController]; 
nc.modalPresentationStyle = UIModalPresentationPopover; 
nc.navigationBar.barStyle = UIBarStyleBlackOpaque; 
相关问题