While developing Notification Content Extension I noticed, it's impossible to change background color to clear color.
I want it looks like background of weather standard app widget.
So, if I change background color of View to clear in IB or by code, it's become white without alpha.
You see that buttons with blurred background and white notification background looks awful. If you have some ideas, please tell me. Tested on iPhone 6 Plus and iPhone 6s iOS 10 beta 3 and Xcode 8 beta 3.
you can try adding a UIBlurEffect
like this:
self.view.backgroundColor = [UIColor clearColor];
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
blurEffectView.frame = self.view.bounds;
blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
blurEffectView.alpha = 0.5;
[self.view insertSubview:blurEffectView atIndex:0];
you can play with background color or with UIBlurEffectStyle
to achieve exact thing that you like.
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.