detail page
This commit is contained in:
		
							
								
								
									
										26
									
								
								Pixiview.iOS/Renderers/AdaptedNavigationPageRenderer.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								Pixiview.iOS/Renderers/AdaptedNavigationPageRenderer.cs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
using Pixiview.iOS.Renderers;
 | 
			
		||||
using Pixiview.UI;
 | 
			
		||||
using UIKit;
 | 
			
		||||
using Xamarin.Forms;
 | 
			
		||||
using Xamarin.Forms.Platform.iOS;
 | 
			
		||||
 | 
			
		||||
[assembly: ExportRenderer(typeof(AdaptedNavigationPage), typeof(AdaptedNavigationPageRenderer))]
 | 
			
		||||
namespace Pixiview.iOS.Renderers
 | 
			
		||||
{
 | 
			
		||||
    public class AdaptedNavigationPageRenderer : NavigationRenderer
 | 
			
		||||
    {
 | 
			
		||||
        public override void WillMoveToParentViewController(UIViewController parent)
 | 
			
		||||
        {
 | 
			
		||||
            if (Element is AdaptedNavigationPage navigation)
 | 
			
		||||
            {
 | 
			
		||||
                NavigationBar.Translucent = true;
 | 
			
		||||
 | 
			
		||||
                var barHeight = NavigationBar.Frame.Height;
 | 
			
		||||
                var statusHeight = UIApplication.SharedApplication.StatusBarFrame.Height;
 | 
			
		||||
                navigation.SetNavigationBarHeight(barHeight, statusHeight);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            base.WillMoveToParentViewController(parent);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -24,10 +24,21 @@ namespace Pixiview.iOS.Renderers
 | 
			
		||||
                //var mode = ForPage.GetLargeTitleDisplay(page);
 | 
			
		||||
                //NavigationItem.LargeTitleDisplayMode = UINavigationItemLargeTitleDisplayMode.Automatic;
 | 
			
		||||
 | 
			
		||||
                page.InitOrientation((Orientation)UIDevice.CurrentDevice.Orientation);
 | 
			
		||||
                page.OnLoad();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected override void Dispose(bool disposing)
 | 
			
		||||
        {
 | 
			
		||||
            if (Element is AdaptedPage page)
 | 
			
		||||
            {
 | 
			
		||||
                page.OnUnload();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            base.Dispose(disposing);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override bool PrefersHomeIndicatorAutoHidden => Screen.GetHomeIndicatorAutoHidden(Element);
 | 
			
		||||
 | 
			
		||||
        public override void ViewDidAppear(bool animated)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,18 +0,0 @@
 | 
			
		||||
using Pixiview.iOS.Renderers;
 | 
			
		||||
using UIKit;
 | 
			
		||||
using Xamarin.Forms;
 | 
			
		||||
using Xamarin.Forms.Platform.iOS;
 | 
			
		||||
 | 
			
		||||
[assembly: ExportRenderer(typeof(NavigationPage), typeof(NavigationPageRenderer))]
 | 
			
		||||
namespace Pixiview.iOS.Renderers
 | 
			
		||||
{
 | 
			
		||||
    public class NavigationPageRenderer : NavigationRenderer
 | 
			
		||||
    {
 | 
			
		||||
        public override void WillMoveToParentViewController(UIViewController parent)
 | 
			
		||||
        {
 | 
			
		||||
            NavigationBar.Translucent = true;
 | 
			
		||||
 | 
			
		||||
            base.WillMoveToParentViewController(parent);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user