Re: UIAccessibilityTraitAdjustable issues
Re: UIAccessibilityTraitAdjustable issues
- Subject: Re: UIAccessibilityTraitAdjustable issues
- From: Matthias Schmitt <email@hidden>
- Date: Fri, 08 Jun 2012 18:21:06 +0200
Hello,
On 08.06.2012, at 14:35, Simon Harris wrote:
> Is there anything special I need to do in order to have accessibilityIncrement/accessibilityDecrement called when VoiceOver is on?
>
> I have a subclass of UIView and I'm overriding accessibleTraits to return [super accessibleTraits] | UIAccessibilityTraitAdjustable; and I've implemented
Here is what was working for me:
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
...
self.accessibilityTraits = [super accessibilityTraits] | UIAccessibilityTraitAdjustable;
}
return self;
}
// My view is able to be moved with the fingers.
// When touchesMoved was handled by the superclass, it was ignored by VO, so I made sure,
// that it will not be handled by touchesMoved when VO is active
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
if (UIAccessibilityIsVoiceOverRunning()) return;
...
[super touchesMoved:touches withEvent:event];
}
- (BOOL)isAccessibilityElement
{
return YES;
}
- (void)accessibilityElementDidBecomeFocused
{
self.accessibilityTraits = [super accessibilityTraits] | UIAccessibilityTraitAdjustable | UIAccessibilityTraitSelected;
}
- (void)accessibilityElementDidLoseFocus
{
self.accessibilityTraits = [super accessibilityTraits] | UIAccessibilityTraitAdjustable;
}
- (void)accessibilityIncrement
{
// whatever my app wanted to do
...
}
- (void)accessibilityDecrement
{
// whatever my app wanted to do
...
}
I hope you can find some inspiration for debugging in these lines.
Best regards
Matthias Schmitt
magic moving pixel s.a.
23, Avenue Grande-Duchesse Charlotte
L-3441 Dudelange
Luxembourg
Phone: +352 54 75 75 - 0
http://www.mmp.lu
_______________________________________________
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