iPhone CoreText: Find the pixel coordinates of a substring

后端 未结 4 1667
故里飘歌
故里飘歌 2021-01-30 19:09

Here\'s a screenshot of the twitter app for reference: http://screencast.com/t/YmFmYmI4M

What I want to do is place a floating pop-over on top of a substring in an NSAtt

4条回答
  •  无人及你
    2021-01-30 19:45

    you need to find Y by CTLine and X by CTRun width and height you can get by word and font itself. ill attache my project link, its really simple code but you can reedit in order to meet your needs. hope it helps cheers if you improve general logic please let me know thx. textViewProject

提交回复
热议问题