Xamarin iOS - how can we set accessibility focus t

2019-08-03 20:02发布

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!

1条回答
小情绪 Triste *
2楼-- · 2019-08-03 20:33

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);
查看更多
登录 后发表回答