• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Can't set a UILabel to not be accessible
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't set a UILabel to not be accessible


  • Subject: Re: Can't set a UILabel to not be accessible
  • From: Richard Groves <email@hidden>
  • Date: Tue, 09 Jul 2013 15:16:11 +0100

Yeah - I've made a small test project and can't reproduce the error.

Setting accessibilityLabel to @"" still seems to make it stop there as you swipe VO from element to element. I've got rid of it completely by setting accessibilityElementsHidden to YES.

Have narrowed down the problem some more. It seems to occur as soon as I set accessibilityIdentifier to a non-nil value (we use that in automated testing throughout the app).

Revised code:

UILabel* dn = [[UILabel alloc] initWithFrame:CGRectMake(15, 61, 250, 34)];

dn.accessibilityIdentifier = @"some text";

NSLog(@"DN-a11y A: %@", dn.isAccessibilityElement ? @"YES" : @"NO");
dn.isAccessibilityElement = NO; // Going to add the day name to the location name to make one item
NSLog(@"DN-a11y B: %@", dn.isAccessibilityElement ? @"YES" : @"NO");
dn.accessibilityIdentifier = nil;
NSLog(@"DN-a11y C: %@", dn.isAccessibilityElement ? @"YES" : @"NO");
dn.isAccessibilityElement = NO;
NSLog(@"DN-a11y D: %@", dn.isAccessibilityElement ? @"YES" : @"NO");
dn.accessibilityElementsHidden = YES; // Fixes the setIsAccessibilityElement not working by hiding it
[self.view addSubview:dn];

produces an output of:

2013-07-09 15:10:21.687 BBC Weather[38546:c07] DN-a11y A: YES
2013-07-09 15:10:21.687 BBC Weather[38546:c07] DN-a11y B: YES
2013-07-09 15:10:21.687 BBC Weather[38546:c07] DN-a11y C: NO
2013-07-09 15:10:21.687 BBC Weather[38546:c07] DN-a11y D: NO

which is very confusing. This exact same lump of code in a test project produces the expected output of 4 NO's.

Both projects running in same Xcode 4.6.3, targeting iOS5.0 running in simulator 6.1 or iPhone 5 with latest iOS (well, latest 6.X)

Very confusing. Obviously something in the setup/running of the main project causing the problem, but I've no idea on how to find out what!

On Fri, Jul 5, 2013 at 9:09 PM, David Dunham <email@hidden> wrote:
Weird, I have code which is

        label = [self smallLabelWithText: @"Ours" bold: NO top: &top left: usLeft width: valueWidth];
        label.textAlignment = UITextAlignmentRight;
        label.isAccessibilityElement = NO;
        [fScroller addSubview: label];

and it seems just fine (the extraneous label gets skipped).

Can you change the accessibilityLabel to @"" as a workaround?

David Dunham
Twitter: @radiofreelunch      http://www.pensee.com/dunham/




--
Richard Groves
Technical Director | NoodlFroot

M: +44 (0)7962 054 163

www.noodlfroot.com

NoodlFroot Limited is a company registered in England and Wales with registration number 07245048.
Registered office: 145-157 St John Street, London, EC1V 4PY.
 _______________________________________________
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

  • Follow-Ups:
    • Re: Can't set a UILabel to not be accessible
      • From: Chris Fleizach <email@hidden>
References: 
 >Re: Can't set a UILabel to not be accessible (From: David Dunham <email@hidden>)

  • Prev by Date: Re: Can't set a UILabel to not be accessible
  • Next by Date: Re: Can't set a UILabel to not be accessible
  • Previous by thread: Re: Can't set a UILabel to not be accessible
  • Next by thread: Re: Can't set a UILabel to not be accessible
  • Index(es):
    • Date
    • Thread