【发布时间】:2011-11-17 14:43:52
【问题描述】:
我想制作透明的 NSTableView。
我在这里使用 WindowController 类。
我正在尝试这个:
- (void)windowDidLoad
{
[super windowDidLoad];
[[self enclosingScrollView] setDrawsBackground: NO];
[[self enclosingScrollView] setBorderType:NSNoBorder];
}
- (BOOL)isOpaque {
return NO;
}
- (void)drawRect:(NSRect)drawRect
{
[super drawRect: drawRect];
}
但是当我编写这段代码时,我在帮助窗口中找不到enclosingScrollView。
你可以看这里..
有什么帮助吗??如果我做错了什么,请记住我或纠正我。
谢谢。
【问题讨论】:
-
得到答案..!!!我刚试过这个
[tableview setBackgroundColor:[NSColor clearColor]];[tableview setHeaderView:nil];,它工作正常.. -
这对我也有用。专门将背景颜色设置为 clearColor
标签: macos xcode4 transparency nstableview