mrs.bassim
mrs.bassim

Reputation: 479

side menu view is not shown

i have a side menu in a controller ..

i'm dealing with it like this:

@IBOutlet weak var sidemenuconstraint: NSLayoutConstraint!

  @IBAction func sidmenu(_ sender: Any) {

    if isSidemenuHidden{
        sidemenuconstraint.constant = 0
        UIView.animate(withDuration: 0.3, animations: {
            self.view.layoutIfNeeded()
        })
    }else {
        sidemenuconstraint.constant = -284
        UIView.animate(withDuration: 0.3, animations: {
            self.view.layoutIfNeeded()
        })
    }
    isSidemenuHidden = !isSidemenuHidden

}

and here is a screenshot of the scene:

enter image description here

enter image description here its working when i click .. the problem is that the side menu view is behind the other views.. i cannot access the buttons in it .. and the view is not shown .. the buttons will only appears and can't press them!

enter image description here

how to solve this?

Upvotes: 0

Views: 62

Answers (1)

Bamse
Bamse

Reputation: 493

I guess you have to change the zIndex of the menu, make an outlet of the sideMenu view and try yourSideMenuViewOutlet.layer.zPosition = 5. This can also be added directly via storyboard in the "identity inspector" at the "user defined runtime attributes" section.

Upvotes: 1

Related Questions