2011-07-13 35 views
0

上的按钮,单击我加入一个新行我的tableView &重新加载表视图。我的表都有的NSTextField细胞&我使用下面的代码在编辑模式下的电池是不是在Mac应用程序透明

[tempArray addObject:@""]; 
[tableView reloadData]; 
[tableView editColumn:0 row:[tempArray count]-1 withEvent:nil select:YES]; 
[tableView setNextResponder:self]; 

-(void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex 
{ 
    [cell setFocusRingType:NSFocusRingTypeNone]; 
    [cell setBackgroundColor:[NSColor clearColor]]; 

    if([[tableColumn identifier] isEqualToString:@"DataIdentifier"]) 
    { 
     [cell setDrawsBackground:NO]; 
     [cell setTextColor:[NSColor grayColor]]; 
     [cell setFont:[NSFont fontWithName:appDelegate.selectedFont size:appDelegate.selectedFontSize]]; // somewhat like 16 on the pad  
    } 
} 

发生了什么现在在编辑模式下我的细胞是不透明的。它有白色background.Please帮助!

回答

0

尝试将NSTextFieldCell的背景颜色设置为与您的tableview背景颜色相同。

使用方法setBackgroundColor:

相关问题