Hello,
After step-by-step debugging, this issue is caused by the camera view not being pushed to the page.
After you create the camera view, the MainPage is pushed again in the source code, causing the page to not display the camera.
// run this on the main thread ...
Shell.Current.Navigation.PushAsync(contentPage);
To fix this issue, you need to push the camera view into the navigation stack to display it.
Microsoft.Maui.ApplicationModel.Platform.GetCurrentUIViewController().PresentModalViewController(cameraViewController,true);
Note: For camera-related features, you could only test them on a physical device.
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.