diff options
author | Rui Marinho <me@ruimarinho.net> | 2017-05-24 18:29:09 +0100 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2017-05-24 10:29:09 -0700 |
commit | 8f7b1f7f17f462caa05b84a96ea23ba622c1b771 (patch) | |
tree | 1322c0377ddc603326ce30102ebb85b70370001f /Xamarin.Forms.ControlGallery.iOS | |
parent | cd61a94c5e2f16c4423bbb1e8b7b74287f491984 (diff) | |
download | xamarin-forms-8f7b1f7f17f462caa05b84a96ea23ba622c1b771.tar.gz xamarin-forms-8f7b1f7f17f462caa05b84a96ea23ba622c1b771.tar.bz2 xamarin-forms-8f7b1f7f17f462caa05b84a96ea23ba622c1b771.zip |
[iOS] Handle user popping pages out of order (#934)
* [iOS] Handle when user can call pop a page that was already disposed/removed
* [Controls] Fix bug number
Diffstat (limited to 'Xamarin.Forms.ControlGallery.iOS')
-rw-r--r-- | Xamarin.Forms.ControlGallery.iOS/CustomRendererBugzila38731.cs | 29 | ||||
-rw-r--r-- | Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj | 1 |
2 files changed, 30 insertions, 0 deletions
diff --git a/Xamarin.Forms.ControlGallery.iOS/CustomRendererBugzila38731.cs b/Xamarin.Forms.ControlGallery.iOS/CustomRendererBugzila38731.cs new file mode 100644 index 00000000..0ae8d969 --- /dev/null +++ b/Xamarin.Forms.ControlGallery.iOS/CustomRendererBugzila38731.cs @@ -0,0 +1,29 @@ +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) + { + NavigationController.TopViewController.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem( + UIImage.FromFile("bank.png"), UIBarButtonItemStyle.Plain, (sender, args) => + { + NavigationController.PopViewController(true); + }), true); + } + } + } +} diff --git a/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj b/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj index 4e2e7706..00d23ecc 100644 --- a/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj +++ b/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj @@ -169,6 +169,7 @@ <Compile Include="Properties\AssemblyInfo.cs" /> <None Include="packages.config" /> <Compile Include="CustomRenderers.cs" /> + <Compile Include="CustomRendererBugzila38731.cs" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Xamarin.Forms.Controls\Xamarin.Forms.Controls.csproj"> |