コード例 #1
0
        NSScrollView SetupTableView()
        {
            _tableView = new GridTableView(Title, Self);
            AddTableColumns(_tableView);
            NSProcessInfo info = new NSProcessInfo();

            if (info.IsOperatingSystemAtLeastVersion(new NSOperatingSystemVersion(10, 13, 0)))
            {
                _tableView.UsesAutomaticRowHeights = true; // only available in OSX 13 and above.AddTableColumns(_tableView);
            }
            var scrollView = new NSScrollView
            {
                DocumentView          = _tableView,
                HasVerticalScroller   = true,
                HasHorizontalScroller = true,
                AutohidesScrollers    = true,
                WantsLayer            = true,
                Layer = new CALayer {
                    Bounds = new CGRect(0, 0, 0, 0)
                },
                Bounds = new CGRect(0, 0, 0, 0)
            };

            scrollView.ContentView.AutoresizingMask    = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable;
            scrollView.ContentView.AutoresizesSubviews = true;
            scrollView.ScrollRectToVisible(new CGRect(0, 0, 0, 0));
            return(scrollView);
        }
コード例 #2
0
        private void CreateLaContext()
        {
            var info = new NSProcessInfo();

#if __MAC__
            var minVersion = new NSOperatingSystemVersion(10, 12, 0);
            if (!info.IsOperatingSystemAtLeastVersion(minVersion))
            {
                return;
            }
#else
            if (!UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                return;
            }
#endif
            // Check LAContext is not available on iOS7 and below, so check LAContext after checking iOS version.
            if (Class.GetHandle(typeof(LAContext)) == IntPtr.Zero)
            {
                return;
            }

            _context = new LAContext();
        }
コード例 #3
0
        public NSScrollView SetupView()
        {
            _printView = new GridTableView("PrintView", Self);
            AddTableColumns(_printView);
            NSProcessInfo info = new NSProcessInfo();

            if (info.IsOperatingSystemAtLeastVersion(new NSOperatingSystemVersion(10, 13, 0)))
            {
                _printView.UsesAutomaticRowHeights = true; // only available in OSX 13 and above.
            }
            var scrollView = new NSScrollView
            {
                DocumentView          = _printView,
                HasVerticalScroller   = false,
                HasHorizontalScroller = false,
                WantsLayer            = true,
                Layer  = NewLayer(),
                Bounds = new CGRect(0, 0, 0, 0)
            };

            scrollView.ContentView.AutoresizingMask    = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable;
            scrollView.ContentView.AutoresizesSubviews = true;
            return(scrollView);
        }
コード例 #4
0
ファイル: Platform.macos.cs プロジェクト: josephwambura/maui
 internal static bool HasOSVersion(int major, int minor)
 {
     using var info = new NSProcessInfo();
     return(info.IsOperatingSystemAtLeastVersion(new NSOperatingSystemVersion(major, minor, 0)));
 }