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

[Bug] Camera preview on iOS is not working when is initially not visible #9623

@Mikilll94

Description

@Mikilll94

Description

I have did a little modification in sample code from here:
https://docs.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/customrenderers-view/

and I have added a button to change the visibility of camera preview control. On Android everything works fine:
camera_view_android

But on iOS the camera preview is not displayed. You can check this by lanching this project on a real iPhone device.
Xamarin_Forms___View_Custom_Renderer.zip

This is because I have set the CameraPreview control to have IsVisible property to be initially false

<controls:CameraPreview x:Name="cameraPreview" IsVisible="False" Camera="Rear" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" />

If we remove IsVisible="False" it works fine.

Steps to Reproduce

  1. Launch the project which I have pasted above on a real iPhone device.
  2. Click the "show" button to show the camera preview.
  3. As you can see camera preview is not displayed.
  4. Run the same project on Android.
  5. Click the "show" button.
  6. As you can see camera view is displayed fine

Expected Behavior

Camera preview should be displayed fine on both iOS and Android.

Actual Behavior

Camera preview is displayed only on Android.

Basic Information

  • Version with issue: 4.4.0.991265
  • Last known good version: none
  • IDE: Visual Studio 2019 16.4.5
  • Platform Target Frameworks:
    • iOS: 11.0
    • Android: 9.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions