Reputation: 37581
I don't know when or how this changed but the x value for the origin of my main view within my view controller has somehow become set to 160 when it used to be 0; and I can't set it back.
However despite being set at 160 everything displays properly - provided every child within the view also has its x set to 160. How is this possible? - As the width of the view is 320 why is it being displayed in full and not shifted half way across the screen? I don't want it be be displayed shifted over the screen but I don't understand why it isn't so would like to know.
Secondly how can I set it back to be 0?
Upvotes: 0
Views: 48
Reputation: 1643
Do like this.. It makes your view x cordinate to zero. Just tap the Point I marked i Rectangle. Your view is top-center. You set upper-left means your view x cordinate to 0...
Upvotes: 1
Reputation: 7390
If you look at the square in the upper-left labeled "Origin", you'll see that the origin of your view is being defined as the top-center of the view. (That's what that little T at the top of the square means.) When your view is centered and takes up the whole screen, the top-center of your view is at coordinates (160, 0). That's why X is set to 160.
If you want the origin to be displayed as (0, 0), click on the upper-left dot in that square, setting the origin to be the top-left corner of the view.
Upvotes: 6