Re: Hiding children of view with height == 0
Re: Hiding children of view with height == 0
- Subject: Re: Hiding children of view with height == 0
- From: Christiaan Hofman <email@hidden>
- Date: Tue, 24 Nov 2009 18:55:18 +0100
On Nov 24, 2009, at 18:44, Ross Carter wrote:
> Thanks, Patty and Mike, for quickly answering my question about NSSegmentedControl.
>
> I have some NSView subclasses that are hidden from view by setting their height to 0. I use this rather than setHidden:NO because the height is set by an animation, which makes the views look like they are rolling up.
>
> It looks like AX subviews of hidden views, but not views that have 0 height or views that are not visible on screen because they are clipped. In those situations, I am doing this in the view subclass:
>
> - (id)accessibilityAttributeValue:(NSString *)attribute {
> if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
> if ([self frame].size.height < 1.0) {
> return nil;
> }
> }
> return [super accessibilityAttributeValue:attribute];
> }
>
> Is that the correct approach?
No.
At a minimum, I'd say you should override -accessibilityIsIgnored. Probably better is to explicitly use setHidden: anyway. It's not just accessibility that is affected by this. You could set it with a delayed perform with a delay equal to the animation duration.
Christiaan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden