swift -> t jump (pop) new translucent UIViewController

 

For example, if you want to jump from A to B, and then B requires semi-transparency, under normal circumstances, setting a semi-transparent background in B will only be effective during the animation process, and the animal will not be transparent after execution.

 

first page A

            let v = Guide();
            v.view.backgroundColor = UIColor.init(white: 0, alpha: 0.5);
            self.present(v, animated: true, completion: nil);

 

 

 

Then set it in viewDidLoad of B (Guide in the above) page

self.modalPresentationStyle = .custom;

 

 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326266474&siteId=291194637