After removing the height anchor, below is the output
screenshot of precise constant
Below is the view controller design. Took the screenshot from IB.
I want to change the position and size of the UIButton created using Interface Builder. I am doing it programmatically using Constraints. also learning the constraints. I have written the code of constraints. Please help me.
let size = self.view.frame.size.height -
(self.layer.frame.size.height + (self.navigationController?.navigationBar.frame.height)! + 20)
channelShowBtn?.translatesAutoresizingMaskIntoConstraints = false
channelShowBtn!.topAnchor.constraint(equalTo:self.view.topAnchor , constant:(((20 + (navigationController?.navigationBar.frame.height)!) + self.layer.frame.height))).isActive = true
channelShowBtn!.heightAnchor.constraint(equalToConstant:size).isActive = true
channelShowBtn!.widthAnchor.constraint(equalToConstant:39).isActive = true
Position and size should change but actually it is not changing.