Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8853205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:35:41+00:00 2026-06-14T13:35:41+00:00

I have a bunch of buttons on the screen which are positioned intuitively visually

  • 0

I have a bunch of buttons on the screen which are positioned intuitively visually but are not read in an intuitive order by VoiceOver. This is because certain buttons like Up and Down are placed above and below each other. However, voiceover starts reading from Left to Right, from Top to Bottom, it seems.

This results in voiceover reading the button to the right of “Up” after “Up”, instead of reading “Down” immediately afterward.

How do I force voiceover to read the button that I want to read? I should mention that I’m using the swipe-to-cycle-through-elements feature on voiceover.

All my buttons are subclassed versions of UIView and UIButton. Here’s an example of a button initiator I use. Ignore the pixel count – I know that’s bad form but I’m in a pinch at the moment:

UIButton* createSpecialButton(CGRect frame, 
                                 NSString* imageName, 
                                 NSString* activeImageName,
                                 id target,
                                 SEL obClickHandler) 
{
    UIButton* b = [UIButton buttonWithType:UIButtonTypeCustom];
    [b setImage:[GlobalHelper nonCachedImage:imageName ofType:@"png"] 
       forState:UIControlStateNormal];
    [b setImage:[GlobalHelper nonCachedImage:activeImageName ofType:@"png"] 
       forState:UIControlStateHighlighted];
    [b addTarget:target action:obClickHandler forControlEvents:UIControlEventTouchUpInside];    
    b.frame= frame;
    return b;
}


- (UIButton *) createSendButton {
    CGFloat yMarker = 295;

    UIButton* b = createSpecialButton(CGRectMake(160, yMarker, 70, 45),
                                          @"Share_Btn",
                                          @"Share_Selected_Btn",
                                          self,
                                          @selector(sendAction));
    b.accessibilityHint = @"Send it!";
    b.accessibilityLabel = @"Stuff for voiceover to be added";
    [self.view addSubview:b];

    return b;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T13:35:42+00:00Added an answer on June 14, 2026 at 1:35 pm

    The easiest answer to this lies in creating a UIView subclass that contains your buttons, and responds differently to the accessibility calls from the system. These important calls are:

    -(NSInteger)accessibilityElementCount
    -(id)accessibilityElementAtIndex:
    -(NSInteger)indexOfAccessibilityElement:
    

    I’ve seen a few of these questions, and answered one before, but I’ve not seen a generic example of how to reorder the VoiceOver focus. So here is an example of how to create a UIView subclass that exposes its accessible subviews to VoiceOver by tag.

    AccessibilitySubviewsOrderedByTag.h

    #import <UIKit/UIKit.h>
    @interface AccessibilitySubviewsOrderedByTag : UIView
    @end
    

    AccessibilitySubviewsOrderedByTag.m

    #import "AccessibilityDirectional.h"
    @implementation AccessibilitySubviewsOrderedByTag {
        NSMutableArray *_accessibilityElements;
    }
        //Lazy loading accessor, avoids instantiating in initWithCoder, initWithFrame, or init.
    -(NSMutableArray *)accessibilityElements{
        if (!_accessibilityElements){
            _accessibilityElements = [[NSMutableArray alloc] init];
        }
        return _accessibilityElements;
    }
    // Required accessibility methods...
    -(BOOL)isAccessibilityElement{
        return NO;
    }
    -(NSInteger)accessibilityElementCount{
        return [self accessibilityElements].count;
    }
    -(id)accessibilityElementAtIndex:(NSInteger)index{
        return [[self accessibilityElements] objectAtIndex:index];
    }
    -(NSInteger)indexOfAccessibilityElement:(id)element{
        return [[self accessibilityElements] indexOfObject:element];
    }
    // Handle added and removed subviews...
    -(void)didAddSubview:(UIView *)subview{
        [super didAddSubview:subview];
        if ([subview isAccessibilityElement]){
            // if the new subview is an accessibility element add it to the array and then sort the array.
            NSMutableArray *accessibilityElements = [self accessibilityElements];
            [accessibilityElements addObject:subview];
            [accessibilityElements sortUsingComparator:^NSComparisonResult(id obj1, id obj2){
                // Here we'll sort using the tag, but really any sort is possible.
                NSInteger one = [(UIView *)obj1 tag];
                NSInteger two = [(UIView *)obj2 tag];
                if (one < two) return NSOrderedAscending;
                if (one > two) return NSOrderedDescending;
                return NSOrderedSame;
            }];
        }
    }
    -(void)willRemoveSubview:(UIView *)subview{
        [super willRemoveSubview:subview];
        // Clean up the array. No check since removeObject: is a safe call.
        [[self accessibilityElements] removeObject:subview];
    }
    @end
    

    Now simply enclose your buttons in an instance of this view, and set the tag property on your buttons to be essentially the focus order.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to have a page with a bunch of buttons, each of which
I have a bunch of buttons that have a tapGestureRecognizer linked to them, and
So I have a bunch of buttons on a page, interspersed with other HTML,
I have a whole bunch of buttons that all need to have both a
I have a main menu activity with a bunch of buttons. One button starts
i have a table which contains a bunch of dynamically created radio button lists,
I have bunch of strings, some of which are fairly long, like so: movie.titles
I have bunch of lists like this: out[3] [[3]] [1] forum=28&mid=11883 [2] forum=29&mid=11884 out[4]
We have bunch of Domain Entities which should be rendered to an html format,
I have a bunch of Buttons (custom, with a few extra methods to apply

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.