开发者

Objective C: Determining the coordinates of a 'click'

I'm trying to make a UIImageView loaded with an array for an animation appear on top of a button when it is clicked. The location of the buttons is random so I have no way of initializing the UIImageView with a frame. How开发者_C百科 do I pass in the X and Y coordinates of where the user taps on the screen?


When you hook up the IBAction for the UIButton, it is passed the button object itself when it is called. The UIButton's frame property should give you everything you need.

Also, you don't "click" on iOS, you "tap".

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜