in edit mode the cell is not transparent in mac app
On a button click I am adding a new row to my tableView & reloading the table view .My table has NSTextField Cell & I am using the below code
[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
}
}
What happens is now in edit mode my cell is not transparent.It has white background.Ple开发者_JAVA百科ase help !
Try setting the background color of your NSTextFieldCell to be the same as your tableview's background color.
Use the method setBackgroundColor:
精彩评论