I wonder what is the way to gray out portion of a view similar to the way UIAlertView grays out everything except the message box? Right now i use another custom view on top of the target area, but it doesnt look as nice.
Any ideas?
There might be restrictions set up on your device, so tap Settings > Screen Time > Content & Privacy > scroll to Allow Changes, and check to see if Account changes are allowed. If not, enable them and check to see if your Apple ID is no longer grey.
Is screen time set up on your iPhone? If so, check under Settings > Screen Time > Content & Privacy Restrictions. If Account Changes is enabled there, you won't be able to select your name.
I get good results using the method you have already tried. perhaps fiddling around with the alpha is a good idea?
mask = [[UIView alloc] initWithFrame:window.frame];
[mask setBackgroundColor:[UIColor colorWithWhite:0.0 alpha:0.78]];
[self.view addSubview:mask];
Then later in your code you can remove it:
[mask removeFromSuperview];
or
[mask setHidden:YES];
If you want to make it even better, I suppose you could try using a gradient, either programmatically, or as an image, and using this to darken the edges of the screen such that the content you are displaying forefront appears to be the light source.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With