我是Swift材料组件的新手。
我正在尝试使用MaterialBottomSheet
并禁用关闭控制器的可能性。但是,如果我将属性dismissOnDraggingDownSheet
设置为false
,则无法与底部工作表进行交互。
这是我的代码:
// View controller the bottom sheet will hold
let viewController: SecondController = SecondController()
// Initialize the bottom sheet with the view controller just created
let bottomSheet: MDCBottomSheetController = MDCBottomSheetController(contentViewController: viewController)
bottomSheet.delegate = self
bottomSheet.preferredContentSize = CGSize(width: self.view.frame.size.width, height: 150)
bottomSheet.trackingScrollView = scroolView
bottomSheet.dismissOnDraggingDownSheet = false
bottomSheet.dismissOnBackgroundTap = false
// Present the bottom sheet
present(bottomSheet, animated: true, completion: nil)