Getting Tap/Touch Position when selecting a TableView cell
hope to get some help here because this is something that really makes me mad...
I have a view with a tableView, and when I tap a cell I want to present a popOver window pointing the arrow to the cell I tapped.
the things that I think I need is: 1- the position of the cell in the screen (not in the view, because on large tables the Y value of the cell's rect could be grater than screen hight)
or
2- a CGPoint or something similar that represents the point in the screen I tapped.
I can't figured this out, and makes me really mad!!!
Any help will very very very very 开发者_开发问答usefull. Have a nice day.
Take a look at the UIView
method convertPoint:toView:
(using nil as the toView argument).
If I trigger a UIPopoverController from a cell tap, I usually just have it come from the cell, thus:
[popover presentPopoverFromRect:cell.frame inView:cell permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
Thank you Paull!!! the UIView method you recommend is very useful.. but I really didn't use it :D.
You give me an idea when passing the cell as the view to present the popover, I was using "self.view", and I've changed it to self.tableView and it works perfect! jeje
Thank you so much!!! You're the SH@# ;)
精彩评论