How To Set The Center In View In Swift

[Solved] How To Set The Center In View In Swift | Swift - Code Explorer | yomemimo.com
Question : how to set the center in view in swift

Answered by : creepy-capybara-8x3y1q9ktiez

childView.centerXAnchor.constraint(equalTo: parentView.centerXAnchor).isActive = true
childView.centerYAnchor.constraint(equalTo: parentView.centerYAnchor).isActive = true

Source : https://www.hackingwithswift.com/example-code/uikit/how-to-center-a-view-in-its-container | Last Update : Wed, 08 Jul 20

Question : how to set the center in view in swift

Answered by : creepy-capybara-8x3y1q9ktiez

childView.center = parentView.center

Source : https://www.hackingwithswift.com/example-code/uikit/how-to-center-a-view-in-its-container | Last Update : Wed, 08 Jul 20

Answers related to how to set the center in view in swift

Code Explorer Popular Question For Swift