noob: how to center a view
I have created a full screen window, created a view with left and top set to 0. Then I created another view and want to center that within first view, both horizontally and vertically. My attempts to get the left, top, width and height values from either the window of the first view have failed, perhaps due to my not know how to retrieve this information properly. I presume I would have problems retrieving the other dimension/size properties. Can anyone help? Thanks!
1 Answer
-
Accepted Answer
Set the width & height of the 2nd view, don't set the left/right/bottom/top and add it to the first view, it should centre in the containing view.