How to change the position (x, y cordinate) of a view dynamically

I have an application that loads a view into it. I want to put the loaded view in 450pt of y cordinate. How to do it.

Relations Ranjan

+6
objective-c iphone
source share
1 answer

See the documentation for UIView and, in particular, the frame , bounds and center properties

I assume that you are adding a subview so that you want it in a coordinate relative to the parent view. Then you use the frame.

 CGRect r = [subView frame]; r.origin.y = 450.0f; [subView setFrame:r]; 

Something like that.

+11
source share

All Articles