Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIImageView更换图片时渐隐渐现 | 东隅已逝/桑榆非晚 #32

Open
h1z3y3 opened this issue Apr 23, 2021 · 0 comments
Open

UIImageView更换图片时渐隐渐现 | 东隅已逝/桑榆非晚 #32

h1z3y3 opened this issue Apr 23, 2021 · 0 comments

Comments

@h1z3y3
Copy link
Owner

h1z3y3 commented Apr 23, 2021

https://h1z3y3.me/posts/uiimageview-image-fade-out/

实现原理十分简单,使用UIImageView的透明度即可。然后在动画中完成。 alpha = 1 为全透明。 运行图例: 实现代码: //图片渐隐渐现 self.backgroundView.alpha = 0.7; [UIView animateWithDuration:0.5 animations:^{ self.backgroundView.alpha = 1; self.backgroundView.image = [UIImage imageNamed:@"weather_bg_02.jpg"]; }]; 后来我知道了可以用更好的方法实现, 后续会有更……

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant