summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.ControlGallery.iOS/CustomRendererBugzila38731.cs
blob: 54d2ba7f1ce6281fda8a592fb8d66b12510f2afc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.ControlGallery.iOS;
using Xamarin.Forms.Controls.Issues;

[assembly: ExportRenderer(typeof(Bugzilla38731), typeof(CustomRendererBugzila38731))]
[assembly: ExportRenderer(typeof(Bugzilla38731.PageTwo), typeof(CustomRendererBugzila38731))]
[assembly: ExportRenderer(typeof(Bugzilla38731.PageThree), typeof(CustomRendererBugzila38731))]
[assembly: ExportRenderer(typeof(Bugzilla38731.PageFour), typeof(CustomRendererBugzila38731))]

namespace Xamarin.Forms.ControlGallery.iOS
{
	public class CustomRendererBugzila38731 : Platform.iOS.PageRenderer
	{
		public override void ViewWillAppear(bool animated)
		{
			base.ViewWillAppear(animated);

			if (NavigationController.ViewControllers.Length > 1)
			{
				var btn = new UIBarButtonItem(UIImage.FromFile("bank.png"), UIBarButtonItemStyle.Plain, (sender, args) =>
					{
						NavigationController.PopViewController(true);
					});
				btn.AccessibilityIdentifier = "goback";
				NavigationController.TopViewController.NavigationItem.SetLeftBarButtonItem(btn, true);
			}
		}
	}
}