![](/img/trans.png)
[英]How to apply custom font/color and semi-transparent background for my custom view in notification content extension?
[英]Change Notification Content Extension background color
您可以嘗試添加UIBlurEffect
如下所示:
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];
您可以使用背景色或UIBlurEffectStyle
來實現自己喜歡的東西。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.