开发者

How to check the positions of different controls in iPhone

How to check some place is 开发者_如何学运维already reserved by some controls before adding a new control to the view. I have added some buttons in the UIImageView and I want to display some images in a label which I'm getting in a random size from the server.I want to place those images over the empty places in the same view.

After adding the first image in some empty place,how could I know that this place is reserved and I have to place the second image in some other placeand the images and buttons should not overlap over each other.

Can somebody please help me ?


Try using CGRectIntersectsRect on the control's frame property (which it inherits from UIView). http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CGGeometry/Reference/reference.html

I don't believe this will work for rotated views though...hm. See this image for reference: http://cl.ly/3T3d3w0D2I2Q1w1r0m46

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜