***** You can download this project to see the issue *****
I've embedded SLPagingViewSwift in my project.
In the third VC i added a button (and a table):
The button configured to do a segue (Present Modally):
In the target VC i have a button (marked in square green above) that do:
@IBAction func dissmissIt(_ sender: AnyObject) {
dismiss(animated: true, completion: nil)
}
But after the target VC is dismissed i see the button in the third VC in a different location (higher):
The layout is configured, button 40 pixels from the top (and table 8 pixels from the button):
What went wrong?
I guess the initial layout configuration takes the SLPagingViewSwift navigation bar into consideration but after the dismiss it recalculates the layout from the top of the screen.
What is the right way to perform the segue and dismiss the target VC while keeping the layout as designed?
I saw this answer
But i was not sure where to use it. i tried:
nav?.view.translatesAutoresizingMaskIntoConstraints = false
and
controller.view.translatesAutoresizingMaskIntoConstraints = false
But with no luck.
***** You can download this project to see the issue *****
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…