您应该能够在NSTableRowView子类中执行以下操作:
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (!self)
return nil;
// etc...
[self setDraggingDestinationFeedbackStyle:NSTableViewDraggingDestinationFeedbackStyleNone];
return self;
}
- (void)drawDraggingDestinationFeedbackInRect:(NSRect)dirtyRect {
NSRect drawRect = [self bounds];
// Tweaking the size of the drawing rectangle...
aRowRect.size.height--;
aRowRect.size.width-=2;
aRowRect.origin.x++;
NSBezierPath *backgroundPath = [NSBezierPath bezierPathWithRect:drawRect];
[[NSColor redColor] set];
[backgroundPath fill];
[[NSColor greenColor] set];
[backgroundPath stroke];
}
Run Code Online (Sandbox Code Playgroud)
当然,如果您没有构建以圣诞为主题的应用程序,您将需要更改这些颜色.
| 归档时间: |
|
| 查看次数: |
1394 次 |
| 最近记录: |