I've got a custom ViewRenderer, which I'm using to play a video (so far on iOS). This is working, but the MPMoviePlayerController is being cut off at the bottom of the screen - attached screenshot.
I'm pretty sure it's because I'm using the MainScreen.Bounds in my Renderer:
protected override void OnElementChanged (ElementChangedEventArgs<VideoPlayer> e)
{
base.OnElementChanged (e);
_player = new UIVideoPlayer (e.NewElement.FileSource, (RectangleF)UIScreen.MainScreen.Bounds);
base.SetNativeControl (_player);
}
However, if I try to use this.Bounds
or e.NewElement.Bounds
the player is hidden - because these Bounds objects are empty at the time that OnElementChanged is called.
Where/when can I obtain the proper Bounds of the Element so I can fit the Player in it?