在 UILabel 中查找子字符串的坐标
我有一个来自服务器的字符串,我正在 UILabel 上显示它。在该字符串中,我正在识别一些特定的子字符串。我想在该子字符串上放置一个按钮(按钮将是 UILabel 的子视图)。为此,我需要子字符串坐标。我浏览了这个要点,但我无法理解它。
假设我的完整字符串是 abc, 567-324-6554, New York。我希望 567-324-6554 显示在按钮上,为此我需要它的坐标。如何使用上面的链接查找子字符串的坐标?
I have a string coming from server which I am displaying on UILabel. It is within that string, I am identifying some particular substring. I want to place a button on that substring(button will be a subview of UILabel). For this I require substring coordinates. I went through this Gist but I am not able to understand it.
Suppose my complete string is abc, 567-324-6554, New York. I want 567-324-6554 to be displayed on button, for which I need its coordinates. How can I use above link to find coordinates of substring?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您可以使用“
现在新位置”
进行计算,对于 y 类似,您需要考虑 x 的代码。
Might be you can calculate using-
Now New position-
and for y similarly you need to have code with consideration of x.