我需要呈现这样的 View ,而不是全屏,例如弹出窗口或弹出窗口。我不知道这种演示风格有没有名字。有人知道如何做到这一点吗?或者有人可以告诉我在哪里可以找到这个?感谢大家。
最佳答案
打开半透明模态 Controller :
class ViewController: UIViewController {
func openTranslucentController() -> ModalController {
let storyboard: UIStoryboard = UIStoryboard(name: "Controller", bundle: nil)
let controller: ModalController = storyboard.instantiateViewController(withIdentifier: "ControllerIdentifier") as! ModalController
controller.view.backgroundColor = UIColor.black.withAlphaComponent(0.5)
controller.modalPresentationStyle = .overCurrentContext
self.present(controller, animated: true, completion: nil)
}
}
现在,您可以按照需要的方式进行设计。
关于swift - 如何创建或呈现这样的 View Controller (Facebook Modally 方式?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55327857/