UIVisualEffectView不支持iPad2和iPhone4S以及以下机型

问题描述:在Extension中增加Blur浮层,显示的Blur效果为透明灰色。代码如下:

UIImage *image=[UIImage imageNamed:@"Grass.jpg"];
UIImageView *imageView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 300, 300)];
imageView.image=image;
[self.view addSubview:imageView];

UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
UIVisualEffectView *bluredEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
[bluredEffectView setFrame:[imageView bounds]];
[self.view addSubview:bluredEffectView];

问题解决:查了下资料,UIVisualEffectView对iPad2和iPhone4S以及以下机型不支持。用第三方的FXBlurView也是得到用默认tintColor填充的色块。模糊功能需要硬件加速,早期的设备不支持。

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注