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 8378503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:56:39+00:00 2026-06-09T15:56:39+00:00

I am trying to make an existing app as accessible as possible for voice

  • 0

I am trying to make an existing app as accessible as possible for voice over.

Currently, I have a uiviewcontroller thats basically a paging photo view with a uipagecontrol below the uiscrollView (tourScrollView) that indicates the current image/page being viewed.

here’s the code that calculate’s the current page:

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
    CGFloat pageWidth = scrollView.frame.size.width;
    self.tourScrollView.isAccessibilityElement = NO;
    scrollView.isAccessibilityElement = NO;
    int currentPage = floor((scrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 1;
    pageControl.currentPage = currentPage;
}

the page calculation code works perfect.

There are a total of 5 images being shown.

With voice over enabled, when the scroll view scrolls, instead of going

page 1 of 5
page 2 of 5
page 3 of 5
page 4 of 5
page 5 of 5

it goes like this.

page 1 of 6
page 2 of 6
page 3 of 6
page 5 of 6
page 6 of 6

Here’s the code where the images are added to the scrollView

-(void)addImagesToScrollview{

    NSArray *welcomeImages = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"img-01.png"],
                              [UIImage imageNamed:@"img-02.png"],
                              [UIImage imageNamed:@"img-03.png"],
                              [UIImage imageNamed:@"img-04.png"],
                              [UIImage imageNamed:@"img-05.png"],nil];

    CGRect scrollViewFrame = tourScrollView.frame;
    CGFloat scrollViewWidth = scrollViewFrame.size.width;
    CGFloat scrollViewHeight = scrollViewFrame.size.height;
    CGFloat imageX;
    for (int i = 0; i<[welcomeImages count]; i++) {

        int index = i;
        imageX = (scrollViewWidth*index) + (scrollViewWidth - IMAGE_WIDTH)/2.0;

        CGRect boarderViewRect = CGRectMake(imageX, 20.0f, IMAGE_WIDTH, IMAGE_HEIGHT);

        UIView *whiteBorderView = [[UIView alloc] initWithFrame:boarderViewRect];
        whiteBorderView.backgroundColor = [UIColor whiteColor];

        UIImageView *imageView = [[UIImageView alloc]initWithImage:[welcomeImages objectAtIndex:i]];
        CGRect imageRect = CGRectInset(boarderViewRect, IMAGE_INSET, IMAGE_INSET);
        imageView.frame = imageRect;

        CGRect descriptionRect = CGRectMake((scrollViewWidth*index) + 20.0f, imageRect.origin.y + imageRect.size.height+10, 280, 90);
        CGSize maximumLabelSize = CGSizeMake(descriptionRect.size.width,120);
        descriptionRect.size = [[self descriptionForIndex:i] sizeWithFont:[UIFont systemFontOfSize:16.0] constrainedToSize:maximumLabelSize lineBreakMode:UILineBreakModeTailTruncation];
        UILabel *imageDescription = [[UILabel alloc] initWithFrame:descriptionRect];
        imageDescription.text = [NSString stringWithFormat:@"%@",[self descriptionForIndex:i]];
        imageDescription.numberOfLines = 0;
        imageDescription.backgroundColor = [UIColor clearColor];
        imageDescription.font = [UIFont systemFontOfSize:16.0];
        imageDescription.textColor = [UIColor colorWithRed:(119.0/255.0) green:(119.0/255.0) blue:(119.0/255.0) alpha:1.0];
        imageDescription.textAlignment = UITextAlignmentCenter;
        imageDescription.shadowColor = [UIColor whiteColor];
        imageDescription.shadowOffset = CGSizeMake(0,1);

        [tourScrollView addSubview:whiteBorderView];
        [tourScrollView addSubview:imageView];
        [tourScrollView addSubview:imageDescription];

        if (i == [welcomeImages count]-1) {
            tourScrollView.contentSize = CGSizeMake(imageView.frame.origin.x + scrollViewWidth -((scrollViewWidth - IMAGE_WIDTH)/2.0), scrollViewHeight); 
        }
    }
}

I’d appreciate if someone points me to the right direction to make voice over say the correct page numbers.

update: Enabling/disabling pagingEnabled makes no difference. I think voiceOver overrides the paging calculations I do based on the scrollview size.

  • 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-09T15:56:41+00:00Added an answer on June 9, 2026 at 3:56 pm

    Here’s what fixed it:

    removed the commented code, and added a line for the content size outside the for loop

    -(void)addImagesToScrollview{
    
    NSArray *welcomeImages = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"img-01-welcome.png"],
                              [UIImage imageNamed:@"img-02-welcome.png"],
                              [UIImage imageNamed:@"img-03-welcome.png"],
                              [UIImage imageNamed:@"img-04-welcome.png"],
                              [UIImage imageNamed:@"img-05-welcome.png"],nil];
    
    CGRect scrollViewFrame = tourScrollView.frame;
    CGFloat scrollViewWidth = scrollViewFrame.size.width;
    CGFloat scrollViewHeight = scrollViewFrame.size.height;
    CGFloat imageX;
    for (int i = 0; i<[welcomeImages count]; i++) {
    
        int index = i;
        imageX = (scrollViewWidth*index) + (scrollViewWidth - IMAGE_WIDTH)/2.0;
    
        CGRect boarderViewRect = CGRectMake(imageX, 20.0f, IMAGE_WIDTH, IMAGE_HEIGHT);
    
        UIView *whiteBorderView = [[UIView alloc] initWithFrame:boarderViewRect];
        whiteBorderView.backgroundColor = [UIColor whiteColor];
    
        UIImageView *imageView = [[UIImageView alloc]initWithImage:[welcomeImages objectAtIndex:i]];
        CGRect imageRect = CGRectInset(boarderViewRect, IMAGE_INSET, IMAGE_INSET);
        imageView.frame = imageRect;
    
        CGRect descriptionRect = CGRectMake((scrollViewWidth*index) + 20.0f, imageRect.origin.y + imageRect.size.height+10, 280, 90);
        CGSize maximumLabelSize = CGSizeMake(descriptionRect.size.width,120);
        descriptionRect.size = [[self descriptionForIndex:i] sizeWithFont:[UIFont systemFontOfSize:16.0] constrainedToSize:maximumLabelSize lineBreakMode:UILineBreakModeTailTruncation];
        UILabel *imageDescription = [[UILabel alloc] initWithFrame:descriptionRect];
        imageDescription.text = [NSString stringWithFormat:@"%@",[self descriptionForIndex:i]];
        imageDescription.numberOfLines = 0;
        imageDescription.backgroundColor = [UIColor clearColor];
        imageDescription.font = [UIFont systemFontOfSize:16.0];
        imageDescription.textColor = [UIColor colorWithRed:(119.0/255.0) green:(119.0/255.0) blue:(119.0/255.0) alpha:1.0];
        imageDescription.textAlignment = UITextAlignmentCenter;
        imageDescription.shadowColor = [UIColor whiteColor];
        imageDescription.shadowOffset = CGSizeMake(0,1);
    
        [tourScrollView addSubview:whiteBorderView];
        [tourScrollView addSubview:imageView];
        [tourScrollView addSubview:imageDescription];
    
    //        if (i == [welcomeImages count]-1) {
    //            tourScrollView.contentSize = CGSizeMake(imageView.frame.origin.x + scrollViewWidth -((scrollViewWidth - IMAGE_WIDTH)/2.0), scrollViewHeight); 
    //        }
        }
        tourScrollView.contentSize = CGSizeMake(320.0*[welcomeImages count], scrollViewHeight);
    }
    

    I am still not sure why VO would mess up the page numbers. The scrollview behavior, before and after the fix is still the same (bouncing and paging work identical).

    will update the answer if I get to know more about this issue.

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

Sidebar

Related Questions

Basically I am trying to make a localized copy of an existing English msi
I'm trying to make a facebook app version of an existing page and am
So I'm trying to make a grails app that hooks into an existing DB
I have an existing database I'm trying to put a cake app on top
I am trying to make a program to work on top of an existing
I am fairly new to iOS development and trying make a simple app which
Trying to make a small countdown timer in my app but it's not working.
I am trying to write an Android app to connect to an existing web
I'm trying to make an app that uploads images to an S3 service. from
We're trying to take an existing video with audio (.mov) and make a more

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.