how to make a sliding up panel like the Google Maps app?

后端 未结 2 1856
死守一世寂寞
死守一世寂寞 2020-12-30 12:23

I\'m looking for something like AndroidSlidingUpPanel for iOS. I found MBPullDownController, but it requires two ViewControllers to use, and requires a big change to the arc

2条回答
  •  情书的邮戳
    2020-12-30 13:11

    Sorry for a late response. I created a small lib based on Rob-s answer. https://github.com/hoomazoid/CTSlidingUpPanel

    It's quite simple to use:

    @IBOutlet weak var bottomView: UIView!
    var bottomController:CTBottomSlideController?;
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        //You can provide nil to tabController and navigationController
        bottomController = CTBottomSlideController(parent: view, bottomView: bottomView, 
                        tabController: self.tabBarController!,
                        navController: self.navigationController, visibleHeight: 64)
        //0 is bottom and 1 is top. 0.5 would be center                
        bottomController?.setAnchorPoint(anchor: 0.7)
    }
    

提交回复
热议问题