行距NSTextView [英] line spacing NSTextView

查看:60
本文介绍了行距NSTextView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果在Mac上安装Microsoft Word并打开文档,则可以通过按Command + 2来将行距增加到2.现在我的可可应用程序使用NSTextView.我的用户希望该应用程序具有类似的功能.我查看了NSTextView API,但找不到任何可以帮助我的地方.使用默认的write命令可以完成的操作是吗?

If you install Microsoft word on Mac and open a document, you can increase line spacing to 2 by hitting Command + 2. Now my cocoa app uses NSTextView. And my users want a similar functionality in the app. I looked at the NSTextView apis and could not find any which will help me here. Is this something that can be accomplished using the defaults write command may be ?.

推荐答案

文本视图是显示其模型 NSTextStorage 的视图. NSTextStorage NSAttributedString 的子类.您需要修改文本的属性以用于自定义行距.

Text Views are views to display their model, NSTextStorage. NSTextStorage is a subclass of NSAttributedString. You need to modify the attributes of the text for custom line spacing.

这篇关于行距NSTextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆