简体   繁体   English

ekeventviewcontroller隐藏删除按钮

[英]ekeventviewcontroller hide delete button

I am having tableview EKEvents, if a user taps on an event i will push EKEventViewController. 我正在使用tableview EKEvents,如果用户点击一个事件,我将按下EKEventViewController。

EKEventViewController comes default with delete button in toolbar how can I hide this. EKEventViewController默认带有工具栏中的删除按钮,我该如何隐藏它。

I tried making a custom viewController subclass of EKEventViewController and in viewWillAppear i was hiding the navigationController's toolbar it was working but not properly.Another problem with this it will allows me to navigate to event details which is not required. 我尝试制作一个自定义的EKEventViewController的viewController子类,在viewWillAppear中,我隐藏了navigationController的工具栏,该工具正常但无法正常工作。与此有关的另一个问题是,我可以导航到不需要的事件详细信息。

let eventViewControler = EKEventViewController()
eventViewController.event = self.events[indexPath.row]
eventViewController.allowsEditing = false
self.navigationController.pushViewController(eventViewControler)

How can I hide the only delete button. 如何隐藏唯一的删除按钮。

You can customize rightBarButtonItem. 您可以自定义rightBarButtonItem。

let rightButton : UIBarButtonItem = UIBarButtonItem(title: "", style: UIBarButtonItemStyle.Plain, target: self, action: "")
self.navigationItem.rightBarButtonItem = rightButton

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM