Ejemplo n.º 1
0
        protected override ContentViewGroup CreatePlatformView()
        {
            if (VirtualView == null)
            {
                throw new InvalidOperationException($"{nameof(VirtualView)} must be set to create a ContentViewGroup");
            }

            var viewGroup = new ContentViewGroup(Context)
            {
                CrossPlatformMeasure = VirtualView.CrossPlatformMeasure,
                CrossPlatformArrange = VirtualView.CrossPlatformArrange
            };

            return(viewGroup);
        }
Ejemplo n.º 2
0
        static void InsertInsetView(IScrollViewHandler handler, IScrollView scrollView, View nativeContent)
        {
            if (scrollView.PresentedContent == null || handler.MauiContext?.Context == null)
            {
                return;
            }

            var paddingShim = new ContentViewGroup(handler.MauiContext.Context)
            {
                CrossPlatformMeasure = IncludeScrollViewInsets(scrollView.CrossPlatformMeasure, scrollView),
                Tag = InsetPanelTag
            };

            handler.PlatformView.RemoveAllViews();
            paddingShim.AddView(nativeContent);
            handler.PlatformView.SetContent(paddingShim);
        }
Ejemplo n.º 3
0
 protected override void DisconnectHandler(ContentViewGroup platformView)
 {
     // If we're being disconnected from the xplat element, then we should no longer be managing its chidren
     platformView.RemoveAllViews();
     base.DisconnectHandler(platformView);
 }