I am trying to make a transparent UIView
when using presentViewController
. The problem is that the UIButton
or UIImageView
always are transparent, how can I make them non-transparent?
targetViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"newViewController"];
targetViewController.modalPresentationStyle = UIModalPresentationOverCurrentContext;
[self presentViewController:targetViewController animated:YES completion:nil];
result: https://i.sstatic.net/YJjBv.png
I want UIButton
or UIImageView
to be opaque. How can I do it?
Instead of using UIView's alpha, using clear backgroundColor
targetViewController.view.backgroundColor = [UIColor clearColor];