【发布时间】:2016-01-07 05:25:31
【问题描述】:
我有一个 NSTextField,里面有一个句子。我想为句子中的每个单词找到一个矩形(理想情况下)或位置,以便在这些位置(在 NSTextField 之外)执行操作。
在 NSTextView/UITextView seems achievable 和 NSLayoutManager.boundingRectForGlyphRange 中执行此操作,但没有 NSTextView(和 UITextView)拥有的 NSLayoutManager 似乎更具挑战性。
在 NSTextField 中查找给定单词位置的最佳方法是什么?
【问题讨论】:
-
这个 UILabel 的答案似乎也与 NSTextField 相关stackoverflow.com/questions/21004609/…
标签: swift macos nstextfield