views:

54

answers:

1

Hi Folks,

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

Regards Ranjan

A: 

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

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

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

Something like that.

willcodejavaforfood
@willcodejavaforfoodThanks. Can u pls give an example?Regards
iWasRobot
@willcodejavaforfoodThanks. its done. I had to make a little change.CGRect r = [subView.view frame];r.origin.y = 450.0f;[subView.view setFrame:r];Regards
iWasRobot
Please mark my answer as the correct one :) Glad I could help!
willcodejavaforfood