detail page

This commit is contained in:
2020-05-06 00:16:24 +08:00
parent 98833961a0
commit 190615ab03
15 changed files with 295 additions and 45 deletions

View File

@@ -75,7 +75,7 @@
<Compile Include="Renderers\CardViewRenderer.cs" />
<Compile Include="Renderers\RoundImageRenderer.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="Renderers\NavigationPageRenderer.cs" />
<Compile Include="Renderers\AdaptedNavigationPageRenderer.cs" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />

View 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);
}
}
}

View File

@@ -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)

View File

@@ -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);
}
}
}