MAC 응용 프로그램을 개발 중이며 tableView가 포함되어 있습니다. 선택한 행의 색을 노란색으로 변경하고 싶습니다.NSTableview 하이라이트 색상을 변경하십시오.
[yourtableview setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleNone];
등 NSTableView는 다음 대리자 메서드를 구현 : 당신이 컬럼의 개별 셀을 heighlight하려면
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
{
if ([[aTableView selectedRowIndexes] containsIndex:rowIndex])
{
[aCell setBackgroundColor: [NSColor yellowColor]];
}
else
{
[aCell setBackgroundColor: [NSColor whiteColor]];
}
[aCell setDrawsBackground:YES];
}
이것은 도움이 될 수 있습니다. - http://stackoverflow.com/questions/7038709/change-highlighting-color-in- nstableview-in-cocoa –