我在 Swift 5 iOS 中使用
SWRevealViewController
。我正在使用侧边菜单,但我想将侧边菜单重叠到家庭控制器,但它不起作用。在第一张图片中,我想制作那样的用户界面,在第二张图片中,我正在制作那样的用户界面。
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
// Perform custom reveal animation
let revealViewController = self.revealViewController()
if revealViewController != nil {
revealViewController?.rightViewRevealWidth = UIScreen.main.bounds.width - 50 // Adjust this value as needed
revealViewController?.rearViewRevealOverdraw = 0
revealViewController?.rightViewRevealOverdraw = 0
revealViewController?.rightViewRevealDisplacement = 0
revealViewController?.toggleAnimationType = .easeOut
self.view.addGestureRecognizer(revealViewController!.panGestureRecognizer())
}
}