我试图实现与多个系细胞的NSOutlineView
。NSOutlineView与文字环绕细胞:heigthOfRow
继从这个和其他网站的建议,我想出了在视图的委托下面的代码。
- (CGFloat)outlineView:(NSOutlineView *)outlineView heightOfRowByItem:(id)item {
NSTableColumn *column = [outlineView outlineTableColumn];
NSCell *cell = [column dataCell];
[cell setStringValue:[item valueForKey:@"label"]];
return [cell cellSizeForBounds:NSMakeRect(0.0, 0.0, [column width], CGFLOAT_MAX)].height;
}
轮廓表列中的单元格设置为换行。
我得到的,然而,一个奇怪的图形行为的文本行重叠,如在http://screencast.com/t/ewJUwRmlGZqh。看起来单元格的尺寸合适,但不能压低底层单元格。
有人可以帮助我吗?