the semi-transparent blur bleeds into the entire section.
I just ran into this in one of my apps after scrolling a collection view a bit.
Luckily I was attached to the debugger and was able to debug the view hierarchy. I discovered it to be an instance of a private class called NSScrollPocket which gets added to the NSScrollView.
I set it hidden with:
po (void)[0x977e0b480 setHidden:YES];
The blur over the section went away. Then I called setHidden:NO and it came back.
Usually the scroll pocket appears to be near the top where the pinned section header is but I guess sometimes they have one over the entire section rectangle.
So maybe we can workaround with an NSScrollView subclass like:
-(BOOL)_isPotentialSubviewOuttaPocket:(NSView*)subview
{
Class scrollPocketClass = NSClassFromString(@"NSScrollPocket");
return (scrollPocketClass != nil
&& [subview isKindOfClass:scrollPocketClass]);
}
-(void)didAddSubview:(NSView*)subview
{
[super didAddSubview:subview];
if ([self _isPotentialSubviewOuttaPocket:subview])
{
// outta pocket
subview.hidden = YES;
}
}
But if AppKit sets the hidden property on the scroll pocket at various times maybe we need to just prevent NSScrollPocket from entering the view hierarchy..meh
or perhaps we can use a sledgehammer to make sure instances of NSScrollPocket remain hidden. might have to put it on the grill and sizzle, I mean swizzle that thing
Topic:
UI Frameworks
SubTopic:
AppKit
Tags: