EKCalendarChooser新日历 [英] EKCalendarChooser new Calendar

查看:110
本文介绍了EKCalendarChooser新日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在EKCalendarChooser中显示启用添加新日历,就像默认的iPhone日历应用程序在左上角显示+并允许您定义日历一样?

解决方案

我一直在寻找相同的即用型解决方案,差不多一天,到目前为止没有运气..



<然而,好的是你可以打电话

  [yourEKCalendarChooserInstance setEditing:YES]; 

它会显示添加日历行



但糟糕的是点击/选择没有任何反应。
这是我到目前为止所发现的全部



更新:



这段代码对我有用(测试到目前为止仅在模拟器上):

  EKEventStore * store = [[[EKEventStore alloc] init] autorelease]; 
EKCalendarChooser * chooser = [[EKCalendarChooser alloc] initWithStyle:EKCalendarChooserSelectionStyleSingle displayStyle:EKCalendarChooserDisplayWritableCalendarsOnly eventStore:store];
[chooser setEditing:YES];
[chooser setShowsDoneButton:YES];
[chooser setShowsCancelButton:YES];
UINavigationController * modalController = [[UINavigationController alloc] initWithRootViewController:chooser];
[self presentViewController:modalController animated:YES completion:nil];

此外,当然,您需要为完成/取消按钮提供代理。


Is it possible to show the enable adding new calendars in EKCalendarChooser just like the default iPhone Calendar app shows the + in the upper left corner and allows you to define you calendars?

解决方案

I've been seeking the same ready-to-use solution for almost a day and no luck so far..

The good thing is, however, that you can call

[yourEKCalendarChooserInstance setEditing:YES];

And It will show you the "Add Calendar" row

But the bad thing is that nothing happens on click/select. That's all I found out so far

UPDATE:

this code worked for me (test only on simulator so far):

EKEventStore *store = [[[EKEventStore alloc] init] autorelease];
EKCalendarChooser *chooser = [[EKCalendarChooser alloc] initWithStyle:EKCalendarChooserSelectionStyleSingle displayStyle:EKCalendarChooserDisplayWritableCalendarsOnly eventStore:store];
[chooser setEditing:YES];
[chooser setShowsDoneButton:YES];
[chooser setShowsCancelButton:YES];
UINavigationController *modalController = [[UINavigationController alloc] initWithRootViewController:chooser];
[self presentViewController:modalController animated:YES completion:nil];

In addition, of course, you will need to provide delegate for done/cancel buttons.

这篇关于EKCalendarChooser新日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆