开发者

Display tooltip on UITableView in iPhone

I was wondering if anyone has tried it. I need to show a tooltip within a table view when the user selects a word in the row's text.

Can you please help me or suggest any way for this?

开发者_如何学CThanks in advance!!!!!!


In each cell add a UIView (be it a UITextView, UIImageView or whatever, in fact you can add plenty of additional subviews to it). Say you call it "tooltipView".

Now when user selects text, all you have to do is position (move around) that view near the selection (or where the user touched the row) and set the relative information. To track the selection, you can simply override the - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event method of your cell class and keep checking the point variable and corresponding event.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜