Convert a xamarin.forms.view to an uiview …?

RoexRoex FRMember ✭✭

I work on a xamarin.iOS project and I need to convert a Xamarin.Forms.View to an UIView. I managed to do what I want on Android, but not on iOS.
I have tried to use this method found here:

public static UIView ConvertFormsToNative(Xamarin.Forms.View view, CGRect size)
{
    var renderer = RendererFactory.GetRenderer (view); 
    renderer.NativeView.Frame = size; 
    renderer.NativeView.AutoresizingMask = UIViewAutoresizing.All;
    renderer.NativeView.ContentMode = UIViewContentMode.ScaleToFill; 
    renderer.Element.Layout (size.ToRectangle()); 
    var nativeView = renderer.NativeView; 
    nativeView.SetNeedsLayout ();
    return nativeView;
}

But it's not work in my project ...

Thank you in advance for your help !

Answers

Sign In or Register to comment.