更改NSTable / NSOutlineView的默认字体大小 [英] Changing default font size for NSTable/NSOutlineView

查看:268
本文介绍了更改NSTable / NSOutlineView的默认字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太明白如何改变(减少)我的NSOutlineView中的文本的字体大小。默认文本大于大多数应用程序使用的字体大小。

I dont quite understand how to change (decrease) the font size for the text in my NSOutlineView. The default text is larger than most applications use for their font size.

有一些heirachical的东西,你不要设置字体目录,但你继承

There is some heirachical thing where you dont set the font directory but you inherit from something "above" the table or outline view.

推荐答案

NSOutlineView NSTableView 的子框架。因此,大纲视图也有列,每个列都有自己的单元格。大纲视图将使用与每个列相关联的单元格来绘制其内容。因此,如果您要更改列的字体,您需要更改单元格的字体。

NSOutlineView is a sublcass of NSTableView. So an outline view also has columns, each of which has its own cell associated with it. The outline view will use the cell associated with each column to draw its content. So, if you want to change the font for the column, you'll need to change the font of the cell.

在Interface Builder中的NIB文件窗口中,切换到树视图。在树视图中,展开大纲视图及其每个表列以查找单元格。继续并选择其中一列的文本字段单元格。现在您可以使用检查器将单元格的大小设置为小。 (我建议不要直接设置字体;如果小字体更改在Mac OS X的未来版本(不太可能,但嘿,陌生人的事情发生了),你不必做任何事情,以获得新的字体。)您需要在大纲视图中为每个列重复此步骤。

In your NIB file window in Interface Builder, switch to the tree view. In the tree view, expand the outline view and each of its table columns to locate the cells. Go ahead and selet the text field cell for one of the columns. Now you can use the inspector to set the size of the cell to Small. (I'd recommend against setting the font directly; if the "Small" font changes in a future release of Mac OS X (unlikely, but hey, stranger things have happened) you won't have to do anything to get the new font.) You'll need to repeat this step for each column in your outline view.

您还需要在大纲视图中更改行高。 Interface Builder不够聪明,看不到所有的单元格设置为小控件大小,所以你必须手动设置这一个。

You'll also need to change the row height in your outline view. Interface Builder isn't smart enough to see that all your cells are set to the "Small" control size, so you'll have to set this one by hand.

希望指向正确的方向。

这篇关于更改NSTable / NSOutlineView的默认字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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