【问题标题】:How do I make Bottom Sheet show on viewDidLoad()?如何使底部工作表显示在 viewDidLoad() 上?
【发布时间】:2018-10-07 16:02:14
【问题描述】:

我希望在 viewDidLoad() 上使用 Google 地图的场景中显示底部表,但我在 material.io 网站上找到的唯一底部表示例是通过按钮触发的。

如何使用MDCBottomSheetController 实现这个?

【问题讨论】:

    标签: ios swift material-components-ios


    【解决方案1】:

    @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

    【讨论】:

      猜你喜欢
      • 2020-12-11
      • 2020-07-19
      • 2022-01-18
      • 2020-07-01
      • 2015-02-13
      • 2019-07-27
      • 1970-01-01
      • 2018-06-08
      • 1970-01-01
      相关资源
      最近更新 更多