콘텐츠를 스크롤 할 때 테이블보기 및 개요보기에서 페이드 효과를 그리는 방법을 찾고 있습니다. 또한NSTableView/NSOutlineView의 상단과 하단의 페이드 효과
QuickLook이 창 here에 비슷한 페이드의 비디오 : 여기에 Fantastical 응용 프로그램의 예입니다.
는이 코드와의 tableview의있는 ScrollView를 서브 클래스 노력이 만들려면 :
#define kFadeEffectHeight 15
@implementation FadingScrollView
- (void)drawRect: (NSRect)dirtyRect
{
[super drawRect: dirtyRect];
NSGradient* g = [[NSGradient alloc] initWithStartingColor: [NSColor blackColor] endingColor: [NSColor clearColor]];
NSRect topRect = self.bounds;
topRect.origin.y = self.bounds.size.height - kFadeEffectHeight;
topRect.size.height = kFadeEffectHeight;
NSRect botRect = self.bounds;
botRect.size.height = kFadeEffectHeight;
[NSGraphicsContext saveGraphicsState];
[[NSGraphicsContext currentContext] setCompositingOperation: NSCompositeDestinationAtop];
// Tried every compositing operation and none worked. Please specify wich one I should use if you do it this way
[g drawInRect: topRect angle: 90];
[g drawInRect: botRect angle: 270];
[NSGraphicsContext restoreGraphicsState];
}
을 ... 그러나 이것은 이것은 실제 테이블보기 전에 호출됩니다 아마 때문에, 아무것도 퇴색하지 않았다 그려집니다. 나는 뷰를 기반으로, 이것은 그런데
을 :(있는 tableview 나는이 효과를 부여 할 outlineview을 모두 수행하는 방법에 대한 아무 생각이 없다, 앱은 10.7 만.
당신은 효과 나 당신이 고무되는 응용 프로그램의 아이튠즈 링크의 영상을 제공 할 수 있습니까? – viggio24
@ viggio24가 앱 스토어의 Fantastical 및 다른 예에 대한 동영상 링크를 추가했습니다. – Alex