xmartlabs / XLActionController

Fully customizable and extensible action sheet controller written in Swift
MIT License
3.33k stars 317 forks source link

Periscope add safearea subview #136

Open boboxiaodd opened 5 years ago

boboxiaodd commented 5 years ago

i use these code:

let bottomPadding = UIApplication.shared.keyWindow!.safeAreaInsets.bottom
        if  bottomPadding > 0 {
            print("\(actionController.collectionView.bounds.height) \(UIScreen.main.bounds.height) \(bottomPadding)")
            let bottomView = UIView(frame: CGRect(x: 0.0,
                                                  y: actionController.collectionView.bounds.height - bottomPadding - 5.0,
                                                  width: UIScreen.main.bounds.width,
                                                  height: bottomPadding + 5.0))
            bottomView.backgroundColor = .white
            actionController.collectionView.backgroundView?.addSubview(bottomView)
        }