微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在 UIVisualEffectView 的底部添加淡入淡出

如何解决在 UIVisualEffectView 的底部添加淡入淡出

大家好,我试图让我的模糊视图消失,而不是突然切到墙纸。我是新来的,并且很高兴让它更像我自己。

我最终想要的效果

the effect I'm wanting in the end

关于我想要实现的目标的另一个例子

another example on what I'm trying to achieve

到目前为止我得到了什么

self.diaryPlayerView = [UIView new];
self.MediaPlayerblurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleSystemUltraThinMaterialDark];
self.MediaPlayerEffectView = [[UIVisualEffectView alloc] initWithEffect:[self MediaPlayerblurEffect]];
self.MediaPlayerEffectView.alpha = 1;
[[self diaryPlayerView] setHidden:YES];
[[self MediaPlayerEffectView] setHidden:YES];
[self addSubview:[self MediaPlayerEffectView]];
[self addSubview:[self diaryPlayerView]];

[[self diaryPlayerView] setTranslatesAutoresizingMaskIntoConstraints:NO];
[NSLayoutConstraint activateConstraints:@[
    [self.diaryPlayerView.topAnchor constraintEqualToAnchor:self.topAnchor],[self.diaryPlayerView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor],[self.diaryPlayerView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor],[self.diaryPlayerView.heightAnchor constraintEqualToConstant:140 + [mediaPlayerOffsetValue doubleValue]],]];

[[self MediaPlayerEffectView] setTranslatesAutoresizingMaskIntoConstraints:NO];
[NSLayoutConstraint activateConstraints:@[
    [self.MediaPlayerEffectView.topAnchor constraintEqualToAnchor:self.diaryPlayerView.topAnchor],[self.MediaPlayerEffectView.leadingAnchor constraintEqualToAnchor:self.diaryPlayerView.leadingAnchor],[self.MediaPlayerEffectView.trailingAnchor constraintEqualToAnchor:self.diaryPlayerView.trailingAnchor],[self.MediaPlayerEffectView.heightAnchor constraintEqualToConstant:140 + [mediaPlayerOffsetValue doubleValue]],]];

what i got so far

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。