开发者

How to implement text selection shadow as in UIWebView in a custom view

Here is a image that shows how Good Reader does it just like in the Web View. http://d.pr/mco开发者_如何学C6

My guess is that there is no easy approach for this except add tons of code to touchesBegan, touchesMoved and touchesEnd in the custom view and map location of the string to the offset in the view. (Plus the magnifying glass)

Does anyone have a better solution, or is there something already there I can take advantage of?

Thanks.


In the picture that looks just like a UITextView with user editing disabled. :) Probably want to have a look at that.

eg:

UITextView *myTextView = [[UITextView alloc] initWithFrame:self.view.frame];
[myTextView setEditable:NO];
[self.view addSubview:myTextView];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜