Re: UIAccessibilityTraitAllowsDirectInteraction: how to use it?
Re: UIAccessibilityTraitAllowsDirectInteraction: how to use it?
- Subject: Re: UIAccessibilityTraitAllowsDirectInteraction: how to use it?
- From: Alexander von Below <email@hidden>
- Date: Sun, 20 Nov 2011 15:49:49 +0100
I will be able to take a look at your code tomorrow, but my hunch is that this will not be possible.
I do all my touch handling in touchesBegan: etc
Alex
Am 20.11.2011 um 15:47 schrieb Marco Savaresi:
> Hi again,
>
> as soon as you find a minute, please have a look at my code. This is actually what I'm trying to do, implementing this new feature to a customized keyboard, composed by buttons. I want these buttons tapped only once, and not one tap to select one of them, and then double tap to execute an action.
>
> Ciao,
>
> Marco
>
>
>
> Il giorno 20/nov/2011, alle ore 15:43, Alexander von Below ha scritto:
>
>> To the view.
>>
>> I must re-read your email, but what are you attempting to achieve? AFAIK, the direct touch interaction is not really meant for standard UI Elements, a sample application would be a keyboard.
>>
>> Even things like gesture recognizers for a single tap don't work when you have DirectInteraction on
>>
>> Alex
>>
>> Am 20.11.2011 um 15:42 schrieb Marco Savaresi:
>>
>>> Thanks for your quick reply. But did you assign the UIAccessibilityTraitAllowsDirectInteraction to the view or to the button? I did it to the latter.
>>>
>>> Thanks again,
>>>
>>> Marco
>>>
>>>
>>> Il giorno 20/nov/2011, alle ore 15:39, Alexander von Below ha scritto:
>>>
>>>> I hope I understand your problem correctly, but I may have to re-read it.
>>>>
>>>> Yes, I meant moving the button outside of the frame and the hierarchy of the view with UIAccessibilityTraitAllowsDirectInteraction. I tried to have a "Settings" button within the view but that does not work
>>>>
>>>> HTH
>>>>
>>>> Alex
>>>>
>>>> Am 20.11.2011 um 15:38 schrieb Marco Savaresi:
>>>>
>>>>> Hello Alexander,
>>>>>
>>>>> just tried, both moving the button outside the testView and even removing testView, but nothing changed. Is this what you meant?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Marco
>>>>>
>>>>>
>>>>> Il giorno 20/nov/2011, alle ore 13:13, Alexander von Below ha scritto:
>>>>>
>>>>>> Quick reply: set the button outside the view
>>>>>>
>>>>>> Von meinem iPhone gesendet
>>>>>>
>>>>>> Am 20.11.2011 um 13:08 schrieb Marco Savaresi <email@hidden>:
>>>>>>
>>>>>>> Hello everyone,
>>>>>>>
>>>>>>> I'm attempting to use this new constant, but I found some difficulties. The following is a sample of what I'm trying to do:
>>>>>>>
>>>>>>> - (void)viewDidLoad
>>>>>>> {
>>>>>>> [super viewDidLoad];
>>>>>>> // Do any additional setup after loading the view, typically from a nib.
>>>>>>> UIView *testView = [[UIView alloc] initWithFrame:CGRectMake(0, 140, 320, 320)];
>>>>>>> testView.backgroundColor = [UIColor redColor];
>>>>>>> [self.view addSubview:testView];
>>>>>>>
>>>>>>> UIButton *testButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
>>>>>>>
>>>>>>> testButton.frame = CGRectMake(110, 400, 100, 50);
>>>>>>> testButton.accessibilityTraits = UIAccessibilityTraitAllowsDirectInteraction;
>>>>>>> testButton.accessibilityLabel = @"button";
>>>>>>> [self.view addSubview:testButton];
>>>>>>> [testButton addTarget:self action:@selector(testResult) forControlEvents:UIControlEventTouchUpInside];
>>>>>>>
>>>>>>> label = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 300, 44)];
>>>>>>> label.backgroundColor = [UIColor greenColor];
>>>>>>> [self.view addSubview:label];
>>>>>>> }
>>>>>>>
>>>>>>> - (void)testResult
>>>>>>> {
>>>>>>> label.text = @"hello everyone";
>>>>>>> }
>>>>>>>
>>>>>>> With VoiceOver on, it looks like the button actually responds to one tap only, but the label remains blank. Turning Voice Over off, the label properly reports "hello everyone".
>>>>>>>
>>>>>>> Any idea?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Marco
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> 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