如何在 NStextview 中使选择内容变为粗体?
使用 setFont: range: ?但我在这里想做的只是使选择加粗,因为选择可能有不同的字体属性,所以,任何人都可以知道吗?
Use the setFont: range: ? but what i want to do here is only to make the selection bold as the selection may have different font attribute,so,anyone can tell that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
像这样:
其中范围是要加粗的文本范围。
Like this:
where the range is the range of text you want to make bold.
您还可以像这样模拟 CMD+B 按键:
You could also simulate the CMD+B key press like so: