Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

UIModalPresentationStyle.FormSheet - PageRenderer ?

$
0
0

I am trying to get a page on an iPad to render as a FormSheet when it is called via Navigation.PushModalAsync()

It's not really working.

Here's what I have tried:

Navigation.PushModalAsync(new AdPopupPage());

then

[assembly: ExportRenderer(typeof(AdPopupPage), typeof(AdPopupPageRenderer))]
namespace Common.IOS.Renderers
{
   public class AdPopupPageRenderer :PageRenderer
    {
       public AdPopupPageRenderer()
       {
           this.ModalPresentationStyle = UIModalPresentationStyle.FormSheet;
           this.ModalTransitionStyle = UIModalTransitionStyle.CoverVertical ;

       }

       public override void ViewWillLayoutSubviews()
       {
           base.ViewWillLayoutSubviews();
           if (Device.Idiom == TargetIdiom.Tablet)
           {
               this.View.Superview.BackgroundColor = Color.Transparent.ToUIColor();
               this.View.Bounds = new RectangleF(0, 0, 500, 500);
           }
       }
    }
}

Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>