2

In my xamarin ios application user need to choose "from date" and "to date" to load some data. For this there are two buttons provided so that clicking on each button date picker will be presented.

The problem is after choosing "from date" from date picker the accessibility focus is going to top of the screen, where as the expected behaviour is to focus "to date" button.

So trying to find a way to set focus to the button programmatically but it seems there is no way in xamarin ios.

I have gone through this and this which are available in native ios code but not in Xamarin ios. Found only this on xamarin ios.

Can someone help me out in this regard!

Community
  • 1
  • 1
Narender Reddy
  • 145
  • 1
  • 1
  • 9
  • Are you sure setting the accessibility focus is what you are looking for? It sounds like you just want to scroll the view to the next button after selecting the first... – der_michael Dec 28 '16 at 16:38
  • 1
    @der_michael Yes, I just want to set accessibility focus. And I got the answer from therealjohn – Narender Reddy Dec 30 '16 at 07:32

1 Answers1

4

The code you linked is absolutely available in Xamarin.iOS. Here is a translation:

Obj-c:

UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification,  self.myFirstElement);

C#:

UIAccessibility.PostNotification(UIAccessibilityPostNotification.ScreenChanged, myFirstElement);
therealjohn
  • 2,378
  • 3
  • 23
  • 39