/// <summary> /// On the element changed. /// </summary> /// <param name="e">E.</param> protected override void OnElementChanged(global::Xamarin.Forms.Platform.iOS.ElementChangedEventArgs <global::Xamarin.Forms.View> e) { base.OnElementChanged(e); if (e.NewElement == null) { return; } _callView = e.NewElement as AgoraVideoView; _layout = new UIView(new RectangleF(0, 0, (float)Element.Width, (float)Element.Height)) { Hidden = false }; _videoService = DependencyService.Get <IAgoraService>() as AgoraServiceImplementation; SetNativeControl(_layout); _videoService.SetupView(UpdatedHolder()); }
/// <summary> /// On the element changed. /// </summary> /// <param name="e">E.</param> protected override void OnElementChanged(global::Xamarin.Forms.Platform.Android.ElementChangedEventArgs <global::Xamarin.Forms.View> e) { base.OnElementChanged(e); if (e.NewElement == null) { return; } global::Android.App.Application.SynchronizationContext.Post(_ => { _callView = e.NewElement as AgoraVideoView; _layout = new FrameLayout(Context) { LayoutParameters = new FrameLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent) }; _videoService = DependencyService.Get <IAgoraService>() as AgoraServiceImplementation; SetNativeControl(_layout); _videoService.SetupView(UpdatedHolder()); }, null); }