Re: UIAccessibilityContainer in a table view
Re: UIAccessibilityContainer in a table view
- Subject: Re: UIAccessibilityContainer in a table view
- From: Sean Heber <email@hidden>
- Date: Mon, 09 May 2011 13:04:28 -0500
Thanks - I've now tried a custom UIAccessibilityElement. In order to avoid what I think would become a retain loop, the element does not retain it's view/cell, but instead it's a weak reference since my view already has an array of elements that it's retaining. (In the view's dealloc, I clear the cached element's cell view property to avoid dangling references.)
This appears to work rather well. On occasion, it seems like things still scroll out from under VoiceOver and the highlighted element disappears but keeps working anyway somehow. (If I close my eyes, I can seemingly navigate without problem even though the screen sometimes seems to lose its place and shows no highlighted elements.) Is that normal?
Also, I saw a few messages like this in the console which I think are related to when it loses its place:
2011-05-09 12:56:22.631 AccessibilityTest[1450:707] **** Accessibility: Could not find a valid index for CellElement [1e69f0] (null) {{1.63723e-07, 0}, {4.07031e-10, 1.91852e-07}} in -[UITableViewCellAccessibilityElement indexOfAccessibilityElement:]
2011-05-09 12:56:22.645 AccessibilityTest[1450:707] **** Accessibility: Could not find where CellElement [1e69f0] (null) {{4.07038e-10, 0}, {1.63723e-07, 1.63723e-07}} starts. Was it's parent [[UITableViewCellAccessibilityElement] <UITableViewCell: 0x1639e0; frame = (0 500; 320 100); autoresize = W; layer = <CALayer: 0x163b30>>) <NSIndexPath 0x1daa00> 2 indexes [0, 5] - (null)] set correctly or did it disappear?
I'm not certain if this is something I need to worry about or not, though.
l8r
Sean
On May 9, 2011, at 10:38 AM, Chris Fleizach wrote:
> How are you returning the accessibilityFrame for each of these fake elements?
>
> The way to make it work correctly, I believe, would be to do something like
>
> @implementation FakeElement
>
> ...
>
> - (CGRect)accessibilityFrame
> {
> CGRect bounds = [customTableParentCell boundsForElement:self];
> UIWindow *window = [customTableParentCell window];
> bounds = [customTableParentCell convertRect:bounds toView:window];
> bounds = [window convertRect:bounds toWindow:nil];
>
> return bounds;
> }
>
> @end
>
> On May 9, 2011, at 7:39 AM, Sean Heber wrote:
>
>> I'm trying to put a custom view inside a UITableViewCell which of course lives within a UITableView. I want to make this custom view accessible so I need to make it a UIAccessibilityContainer (since it contains several visual elements that aren't implemented as their own UIViews).
>>
>> When I do this, the location of the elements get all messed up whenever the table scrolls. While paging through the elements using VoiceOver, it will automatically scroll the table to attempt to center the selected element on screen, but then the outline of where VoiceOver thinks the element is no longer lines up with where it is visually.
>>
>> I posted this question (along with code) on StackOverflow awhile back and haven't got any decent answers, so if you think you might be able to help, the details are all here:
>>
>> http://stackoverflow.com/questions/5872453/uiaccessibilitycontainer-in-a-table-view
>>
>> Thanks!
>>
>> l8r
>> Sean
>>
>> _______________________________________________
>> 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
>
>
_______________________________________________
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