Ios 如何轻轻淡入UIImage底部,并在向上滚动时淡入模糊
我一直在使用Ios 如何轻轻淡入UIImage底部,并在向上滚动时淡入模糊,ios,objective-c,uicollectionview,blur,cagradientlayer,Ios,Objective C,Uicollectionview,Blur,Cagradientlayer,我一直在使用UICollectionView标题作为UICollectionReusableView,我试图实现1)轻微的底部褪色图像,2)当用户向上滚动图像时,图像会模糊 我基本上是在看苹果的音乐应用程序,这是一个艺术家的个人资料视图,在我看来,这是一个非常好看的应用程序 轻微褪色的底部 向上滚动模糊 我的出发点是可行的,但我想有一个更微妙的底部褪色,然后一旦我有了这个钉子,想想滚动模糊 应用CAGradientLayer的代码: UIImageView *imageView; image
UICollectionView
标题作为UICollectionReusableView
,我试图实现1)轻微的底部褪色图像,2)当用户向上滚动图像时,图像会模糊
我基本上是在看苹果的音乐应用程序,这是一个艺术家的个人资料视图,在我看来,这是一个非常好看的应用程序
UIImageView *imageView;
imageView = [[UIImageView alloc] initWithFrame:header.bounds];
imageView.image = [UIImage imageWithData:self.guest.profilePic];
[imageView setContentMode:UIViewContentModeScaleAspectFill];
[imageView setClipsToBounds:YES];
CAGradientLayer *gradient = [CAGradientLayer layer];
gradient.frame = imageView.bounds;
UIColor *transWhiteColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.25];
UIColor *endColor = [UIColor whiteColor];
gradient.colors = [NSArray arrayWithObjects:
(id)[transWhiteColor CGColor],
(id)[endColor CGColor],
nil];
[imageView.layer insertSublayer:gradient atIndex:0];
[header addSubview:imageView];
如有任何见解,将不胜感激