wxr
2022-10-09 d6c09ce6fdb01350db2336d287bbd3c123289a30
HDL-ON_iOS/ViewControllerBase.cs
@@ -2,7 +2,7 @@
using System.Drawing;
using Foundation;
using UIKit;
using WebKit;
namespace HDL_ON_iOS
{
    public class ViewControllerBase : Shared.BaseViewController
@@ -58,6 +58,9 @@
            UIView activeView = KeyboardGetActiveView ();
            if (activeView == null)
                return;
            string sss = activeView.ToString();
            if (sss.StartsWith("<WKContentView"))
                return;
            UIView scrollView = activeView.FindSuperviewOfType_Self (this.View, typeof (UIView)) as UIView;
            if (scrollView == null)
                return;
@@ -68,7 +71,8 @@
            CoreGraphics.CGRect viewRectAboveKeyboard = new CoreGraphics.CGRect (this.View.Frame.Location,
                new CoreGraphics.CGSize (this.View.Frame.Width, this.View.Frame.Size.Height - keyboardBounds.Size.Height));
            CoreGraphics.CGRect activeFieldAbsoluteFrame = activeView.Superview.ConvertRectToView (activeView.Frame, this.View);
            if (!viewRectAboveKeyboard.Contains (activeFieldAbsoluteFrame)) {
            if (!viewRectAboveKeyboard.Contains(activeFieldAbsoluteFrame))
            {
                //PointF scrollPoint = new PointF (0.0f,
                //    (float)(activeFieldAbsoluteFrame.Location.Y + activeFieldAbsoluteFrame.Height
                //        + scrollView.ContentOffset.Y - viewRectAboveKeyboard.Height));
@@ -86,6 +90,9 @@
        {
            UIView activeView = KeyboardGetActiveView ();
            if (activeView == null)
                return;
            string sss = activeView.ToString();
            if (sss.StartsWith("<WKContentView"))
                return;
            UIView scrollView = activeView.FindSuperviewOfType_Self (this.View, typeof (UIView)) as UIView;
            if (scrollView == null)
@@ -105,10 +112,12 @@
    {
        public static UIView FindFirstResponder (this UIView view)
        {
            if (view.IsFirstResponder) {
            if (view.IsFirstResponder)
            {
                return view;
            }
            foreach (UIView subView in view.Subviews) {
            foreach (UIView subView in view.Subviews)
            {
                var firstResponder = subView.FindFirstResponder ();
                if (firstResponder != null)
                    return firstResponder;
@@ -117,8 +126,10 @@
        }
        public static UIView FindSuperviewOfType (this UIView view, UIView stopAt, Type type)
        {
            if (view.Superview != null) {
                if (type.IsAssignableFrom (view.Superview.GetType ())) {
            if (view.Superview != null)
            {
                if (type.IsAssignableFrom(view.Superview.GetType()))
                {
                    return view.Superview;
                }
                if (view.Superview != stopAt)
@@ -129,7 +140,8 @@
        public static UIView FindSuperviewOfType_Self (this UIView view, UIView stopAt, Type type)
        {
            if (view.Superview != null) {
            if (view.Superview != null)
            {
                return view.Superview.FindSuperviewOfType_Self (stopAt, type);
            }
            return view;