Skip to content

Instantly share code, notes, and snippets.

@jfversluis
Last active September 22, 2017 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfversluis/e08e9ca7c217daf8d620399670b0b6f1 to your computer and use it in GitHub Desktop.
Save jfversluis/e08e9ca7c217daf8d620399670b0b6f1 to your computer and use it in GitHub Desktop.
Custom renderer for enabling large titles on iOS 11
using System;
using LargeTitleSample;
using LargeTitleSample.iOS;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(NavigationPage), typeof(NavBarRenderer))]
namespace LargeTitleSample.iOS
{
public class NavBarRenderer : NavigationRenderer
{
protected override void OnElementChanged(VisualElementChangedEventArgs e)
{
base.OnElementChanged(e);
if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
NavigationBar.PrefersLargeTitles = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment