Skip to content

Instantly share code, notes, and snippets.

@Char0394
Created October 5, 2017 02:28
Show Gist options
  • Select an option

  • Save Char0394/9f94ec1214d0cc471369a032b0ee1c45 to your computer and use it in GitHub Desktop.

Select an option

Save Char0394/9f94ec1214d0cc471369a032b0ee1c45 to your computer and use it in GitHub Desktop.
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using UIKit;
using ShadowNavBarSample.iOS;
using CoreGraphics;
[assembly: ExportRenderer(typeof(NavigationPage), typeof(ShadowNavigationBarRenderer))]
namespace ShadowNavBarSample.iOS
{
public class ShadowNavigationBarRenderer : NavigationRenderer
{
protected override void OnElementChanged(VisualElementChangedEventArgs e)
{
base.OnElementChanged(e);
if (this.Element == null) return;
NavigationBar.Layer.ShadowColor = UIColor.Gray.CGColor;
NavigationBar.Layer.ShadowOffset = new CGSize(0, 0);
NavigationBar.Layer.ShadowOpacity = 1;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment