I can't hide my EAGLView object for accessibility tools

69 Views Asked by At

I created a cocos2d-x project and there is a class called AppController.mm where an EAGLView object (__glView) is created. The accessibility of __glView is set to true/yes by default but I want it to be false/no so I can access my elements which are behind the EAGLView with an automation tool like UI Automation Tool by Xcode. Now when I try to set the accessibility of that view to false, I use that line of code in AppController.mm after it's created:

[__glView setIsAccessibilityElement:NO];

But this setter doesn't do anything. It ignores that and is still true/yes. In a test project, I override the getter in EAGLView.mm like this:

- (BOOL) isAccessibilityElement
{
    return NO;
}

and it works perfectly fine. The problem in my real project is, that I don't have access to EAGLView.mm so I thought using the setter would be nice but it doesn't do anything.

If I use

[__glView setAccessibilityElementsHidden:YES]

then it works (doesn't ignore it) but of course everything is hidden, so I can't even have access to my own elements which are under EAGLView. I just want to hide this specific __glView.

0

There are 0 best solutions below