开发者

Getting position of UIImageView in xcode

Hey I made a project where multiple UIImageView is randomly created and all of them moves up the screen by NSTimer.

Is there any way to detect the current position of the moving UIImageView?

The moving image is a balloon and I want to "pop" or more like remo开发者_Go百科ve the UIImageView when the User taps any of the balloons.

Thanks for your help.


Try using the frame property of the UIImageView.

if(xValue>CGRectGetMinX(balloon.frame) && xValue<CGRectGetMaxX(balloon.frame) &&
yValue>CGRectGetMinY(balloon.frame) && yValue<CGRectGetMaxY(balloon.frame)) {
  //pop the balloon
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜