我正在尝试用可可实现一个Radiogroup,并使用了apple 使用单选按钮提供的例子。
下面的截图显示了我遇到的问题。即使包含单元格的NSMatrix具有足够大的NSRect,单元格本身也不足以显示标题。
我该怎么纠正呢?

NSButtonCell *prototype = [[[NSButtonCell alloc] init]autorelease];
[prototype setButtonType:NSRadioButton];
[prototype setBordered:YES];//only for testing
_view = [[[NSMatrix alloc] initWithFrame:rect
mode:NSRadioModeMatrix
prototype:(NSCell *)prototype
numberOfRows:3
numberOfColumns:1]autorelease];
NSArray *cellArray = [_view cells];
for (std::size_t index = 0; index < 3; ++index)
{
[[cellArray objectAtIndex:index] setTitle:@"a title"];
}发布于 2015-02-02 11:00:08
使用矩阵的setCellSize。
NSSize size = [_view cellSize];
size.width = 400;
[_view setCellSize:size];https://stackoverflow.com/questions/28275769
复制相似问题