Check out example codes for "how to set the center in view in swift". It will help you in understanding the concepts better.

Code Example 1

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

Code Example 2

childView.center = parentView.center

Learn ReactJs, React Native from akashmittal.com