我想要在 viewDidLoad()
上使用 Google map 的场景中显示底部工作表,但我在 material.io
网站上找到的唯一底部工作表示例被触发使用按钮。
如何使用 MDCBottomSheetController
实现此目的?
最佳答案
@stone-cold 请参阅下面提到的代码。
import MaterialComponents.MaterialButtons
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let bottomSheet = MDCBottomSheetController(contentViewController: viewController)
// Present the bottom sheet
present(bottomSheet, animated: true, completion: nil)
}
}
在此处查看更多详细信息 https://github.com/material-components/material-components-ios/tree/develop/components/BottomSheet
关于ios - 如何让 Bottom Sheet 显示在 viewDidLoad() 上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50051711/