Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit d571396

Browse files
authored
Merge pull request #584 from xamarin/camera_ios_fix
Update PreviewLayer in LayoutSubviews not Draw
2 parents b5c660c + a79fd14 commit d571396

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

CustomRenderers/View/iOS/UICameraPreview.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ public UICameraPreview (CameraOptions options)
2525
Initialize ();
2626
}
2727

28-
public override void Draw (CGRect rect)
28+
public override void LayoutSubviews()
2929
{
30-
base.Draw (rect);
31-
previewLayer.Frame = rect;
30+
base.LayoutSubviews();
31+
32+
if (previewLayer != null)
33+
previewLayer.Frame = Bounds;
3234
}
3335

3436
public override void TouchesBegan (NSSet touches, UIEvent evt)

0 commit comments

Comments
 (0)