【问题标题】:Padding in NSTextView -- possible without custom drawing?NSTextView 中的填充——没有自定义绘图可能吗?
【发布时间】:2008-11-25 21:47:23
【问题描述】:

在 Cocoa 中,NSTextView 在文本和边框之间有一个相当浅的边距。有没有办法为 NSTextView 指定填充(文本和视图边框之间的距离)而不求助于所有者绘图?

【问题讨论】:

    标签: objective-c cocoa user-interface


    【解决方案1】:

    NSTextView 方法setTextContainerInset: 可以满足您的需求。 NSSize 参数的 heightwidth 分量分别指定 verticalhorizo​​ntal 填充量。 p>

    例如

    textView.textContainerInset = NSSize(width: 8, height: 8)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-09-11
      • 1970-01-01
      • 2017-03-06
      • 1970-01-01
      • 2023-03-12
      • 1970-01-01
      • 2017-11-28
      相关资源
      最近更新 更多