Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VoiceOver not scrolling to elements offscreen in landscape?

How can I make a VoiceOver scroll to elements offscreen in a UIScrollView.

I have a UIScrollView. Inside this is a UIView containing a number of subviews. Inside these subviews are labels - something like below:

Scroll View
-> UIView
--> UIView
----> Label
--> UIView
----> Label
--> UIView
----> Label
--> UIView
----> Label
--> UIView
----> Label

When I launch my app in landscape, I can see that some of the elements are offscreen. I can scroll to these without issue. When using VoiceOver however, I can swipe to move through the elements on screen but the app doesn't scroll past the last visible element on the screen by swiping alone. If I rotate the iPad into portrait mode I can swipe to the elements that weren't accessible and continue to swipe to other elements that are off screen in portrait mode. I can use a three finger swipe to move down to the next "page" and select an element to continue, but this isn't what I had expected. I had expected to just keep swiping and the next element would scroll into view.

The app is written in Swift 1.2 using Xcode 6.4 and I'm running the app on an iPad Mini 2 running iOS 8.4

Any ideas?

like image 741
collinsrj Avatar asked Jul 09 '15 13:07

collinsrj


People also ask

What is UI scroll view?

UIScrollView is the superclass of several UIKit classes, including UITableView and UITextView . A scroll view is a view with an origin that's adjustable over the content view. It clips the content to its frame, which generally (but not necessarily) coincides with that of the app's main window.


1 Answers

accessibilityElements

An array of the accessibility elements in the container. You can implement this property instead of the dynamic methods to support the retrieval of the contained elements. The default value of this property is nil.

You can reassign value of accessibilityElements of your accessibility view in following manner:

self.containerView.accessibilityElements = [self.label1,
                                            self.label2,
                                            self.label3,
                                            self.label4,
                                            self.label1]
    

self.scrollView.accessibilityElements = [self.containerView]
like image 128
Vrushank Avatar answered Nov 11 '22 22:11

Vrushank