[英]Hide delete button when tap back button in EKEventViewController
I have using EkEventViewController
to view event in my app. 我已经使用EkEventViewController
在我的应用程序中查看事件。
My code should be like below: 我的代码应如下所示:
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let eventViewController = EkEventViewController()
eventViewController.delegate = self
eventViewController.allowsEditing = true
eventViewController.allowsCalendarPreview = true
eventViewController.hidesBottomBarWhenPushed = true
eventViewController.event = self.events[indexPath.row]
self.navigationController?.pushViewController(eventViewController, animated: true)
}
When I tap back button from EkEventViewController
. 当我从EkEventViewController
点击后退按钮时。 The delete button bar should not hide. 删除按钮栏不应隐藏。 How to hide or remove delete bottom button bar 如何隐藏或删除删除底部按钮栏
Based on your question, I presume that the 'delete' button or border retains after tapping on back button from EKEventViewController
. 根据您的问题,我认为从EKEventViewController
轻按返回按钮后,“删除”按钮或边框仍保留。 The delete button from EKEventViewController
is actually from toolbar
in navigationController
. EKEventViewController
的删除按钮实际上是来自navigationController
toolbar
。 You can hide the toolbar via setToolbarHidden(_ hidden: Bool, animated: Bool)
您可以通过setToolbarHidden(_ hidden: Bool, animated: Bool)
隐藏工具栏
To do so, you have to initialize a new class with the subclass of EKEventViewController
and push your view controller to it. 为此,您必须使用EKEventViewController
的子类初始化一个新类,并将其视图控制器推入EKEventViewController
。 Then, add the line below in your viewWillDisappear
of the new class: 然后,在新类的viewWillDisappear
中添加以下行:
self.navigationController?.setToolbarHidden(true, animated: false)
Do note that this solution is based on assumption that you do not have existing toolbar prior to calling the EKEventViewController
. 请注意,此解决方案基于以下假设:调用EKEventViewController
之前您没有现有的工具栏。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.