Setting VideoGravity to ResizeAspectFill like suggested by @Cole Xia (Shanghai Wicresoft Co,.Ltd.) did the trick!
Frame in Xamarin.iOS does not cover entire screen

Ganesh Gebhard
366
Reputation points
Hey!
I have an app in Xamarin.Forms, but this problem is specifically for iOS.
I use a contentpage for displaying the camera. This contentpage page uses a CameraModel so that this can be used on Android and iOS with custom renderers:
I want the camera to be shown fullscreen on the contentpage. this does works for Android, but for iOS I face the following issue: I have a frame for the camera (in the iOS custom renderer) and it seems that this frame is fullscreen:
The result however is this:
Am I missing something? Or do you need more code to help me?
{count} votes
Accepted answer
-
0 additional answers
Sort by: Most helpful
Hey! So I tried your piece of code, but the problem remains.
I've added the custom renderer for iOS in the attachment.
48220-customrenderer-ios.txt
The Frame of
liveCameraStream
looks no problem , you can set the backgroundColor on it to see the area , it should be a full screen view .Try to set
VideoGravity
toResizeAspectFill
onvideoPreviewLayer
in methodSetupLiveCameraStream
, it is used to determine how the video is displayed within the layer's bounds.