Swift Material Components Bottom Sheet在向下拖动时禁用关闭

时间:2019-12-06 11:41:02

标签: ios swift bottom-sheet material-components material-components-ios

我是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)

0 个答案:

没有答案