How to convert android native AbsoluteLayout to Xamarin.Forms.AbsoluteLayout

KoushikSarkar.6410KoushikSarkar.6410 ✭✭USMember ✭✭

I have a video call sdk which takes a Xamarin.Forms.AbsoluteLayout while initializing, so that it can place the video in that container.

So I have a layout file (.axml) inside which there is an AbsoluteLayout.
I am accessing the AbsoluteLayout programmatically.
But I am getting compilation error on the second line of the code below, [error: cannot convert type Android.View.View to Xamarin.Forms.AbsoluteLayout]
_view = activity.LayoutInflater.Inflate(Resource.Layout.Video, this, false);
var container = (Xamarin.Forms.AbsoluteLayout)_view.FindViewById(Resource.Id.container);

Although if I replace the typecast with (Android.Widget.AbsoluteLayout) everything works fine.

Sign In or Register to comment.