I am newbie to iOS/Swift. I am developing app using Swift4 on XCode12. But I have a problem with presenting UIViewController.
Below is my code:
presenting UIViewController
let scanner = NewController({ ... }) scanner.delegate = self self.present(scanner, animated: true, completion: nil)
NewController
public class NewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate { ... }
But it shows like this image. Image before/after presenting
As you can see in the image, it shows black margin after presenting NewController.
Anybody can help me?
I tested on simulator iPhone 8 (iOS 14.2).
This is the current UX that comes with presenting a View Controller modally. This is the expected output. If you want your view controller to take over the whole screen use pushViewController
instead.
self.navigationController?.pushViewController(scanner, animated: true)
Use popViewController
to dismiss your view controller.
self.navigationController?.popViewController(animated: true)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.