开发者

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

开发者 https://www.devze.com 2023-01-08 09:13 出处:网络
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.

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消