Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Autoscroll keyboard in iOS problem

$
0
0

My code have worked find in Xamarin.iOS. But now i apply Xamarin.Forms into my project, it do not work correct.

My code worked fine when i call Page by PushAsync
```Navigation.PushAsync (new MyPage (), true);


My code do not work correct when i call Page by PushModalAsync ```Navigation.PushModelAsync (new MyPage(), true);

Code in KeyboardUtil.cs
```UIView rootView = UIApplication.SharedApplication.KeyWindow.RootViewController.View;
NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.WillShowNotification, KeyBoardUpNotification);
NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.WillHideNotification, KeyBoardDownNotification);

And i define function to find Entry (active view, focus view)
```void FindActiveView (UIView parentView)
{
    foreach (UIView view in parentView.Subviews) {
        if (view.IsFirstResponder) {
            activeView = view;
            return;
        }
        if (view.Subviews.Length > 0) {
            FindActiveView (view);
        }
    }
}

I cannot find activeView because my current page is on Modal page, and UIApplication.SharedApplication.KeyWindow.RootViewController.View do not return View in modal page.
Can you help me, please ? Or give me some advice to find View in Modal Page !


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>