如何在 SWRevealViewController 中将滑块视图重叠到现有屏幕?

问题描述 投票:0回答:0

我在 Swift 5 iOS 中使用

SWRevealViewController
。我正在使用侧边菜单,但我想将侧边菜单重叠到家庭控制器,但它不起作用。在第一张图片中,我想制作那样的用户界面,在第二张图片中,我正在制作那样的用户界面。

UI Example

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())
    }
}
ios swift swrevealviewcontroller side-menu
© www.soinside.com 2019 - 2024. All rights reserved.