摘要:本文将带你了解IOS开发入门iOS 动画 - 波纹 声波 水波,希望本文对大家学IOS有所帮助。
本文将带你了解IOS开发入门iOS 动画 - 波纹 声波 水波,希望本文对大家学IOS有所帮助。
YSCAnimation
Github地址 : https://github.com/xiaochaofeiyu/YSCAnimation,对你有帮助的话帮我点颗星星哦!
ripple animation
1). singlelineripple --> corresponding class YSCRippleView
[_rippleView showWithRippleType:YSCRippleTypeLine]
2). ringRipple --> corresponding class YSCRippleView
[_rippleView showWithRippleType:YSCRippleTypeRing]
3). cicleRipple --> corresponding class YSCRippleView
[_rippleView showWithRippleType:YSCRippleTypeCircle]
4). mixedripple --> corresponding class YSCRippleView
[_rippleView showWithRippleType:YSCRippleTypeMixed]
wave animation
1). pusle --> corresponding class YSCWaveView
[_waveView showWaveViewWithType:YSCWaveTypePulse]
2). wave --> corresponding class YSCWaveView
[_waveView showWaveViewWithType:YSCWaveTypeVoice]
3). movedWave --> cZ喎?"https://www.2cto.com/kf/ware/vc/" target="_blank" class="keylink">vcnJlc3BvbmRpbmcgY2xhc3MgWVNDV2F2ZVZpZXc8L3A+DQo8cHJlIGNsYXNzPQ=="brush:java;">[_waveView showWaveViewWithType:YSCWaveTypeMovedVoice]
mask animation
1). circleLoad --> corresponding class YSCCircleLoadAnimationView
YSCCircleLoadAnimationView *shapeView = [[YSCCircleLoadAnimationView alloc] initWithFrame:self.view.bounds];
UIImage *image = [UIImage imageNamed:@"tree.jpg"];
shapeView.loadingImage.image = image;
[self.view addSubview:shapeView];
[shapeView startLoading];
2). microphone wave --> corresponding class YSCMicrophoneWaveView
YSCMicrophoneWaveView *microphoneWaveView = [[YSCMicrophoneWaveView alloc] init];
[microphoneWaveView showMicrophoneWaveInParentView:self.view withFrame:self.view.bounds];
3). fanshaped wave --> corresponding class YSCFanShapedView
- (YSCFanShapedView *)fanshapedView
{
if (!_fanshapedView) {
self.fanshapedView = [[YSCFanShapedView alloc] init];
_fanshapedView.frame = CGRectMake(0, 0, 300, 150);
_fanshapedView.center = CGPointMake(self.view.bounds.size.width / 2.0, self.view.bounds.size.height / 2.0 - 100);
}
return _fanshapedView;
}
//show
[self.fanshapedView showInParentView:self.view WithType:YSCFanShapedShowTypeExpand];
voice wave
1). voice wave --> corresponding class YSCVoiceWaveView YSCVoiceLoadingCircleView
//show
self.voiceWaveView = [[YSCVoiceWaveView alloc] init];
[self.voiceWaveView showInParentView:self.voiceWaveParentView];
[self.voiceWaveView startVoiceWave];
//hide
[self.voiceWaveView stopVoiceWaveWithShowLoadingViewCallback:^{
[self.updateVolumeTimer invalidate];
_updateVolumeTimer = nil;
[self.loadingView startLoadingInParentView:self.view];
}];
water wave
1). water wave --> corresponding class YSCWaterWaveView
- (YSCWaterWaveView *)waterWave
{
if (!_waterWave) {
self.waterWave = [[YSCWaterWaveView alloc] init];
_waterWave.frame = CGRectMake(0, 0, self.view.bounds.size.width, 300);
_waterWave.percent = 0.6;
_waterWave.firstWaveColor = [UIColor colorWithRed:146/255.0 green:148/255.0 blue:216/255.0 alpha:1.0];
_waterWave.secondWaveColor = [UIColor colorWithRed:84/255.0 green:87/255.0 blue:197/255.0 alpha:1.0];
}
return _waterWave;
}
//show
[self.view addSubview:self.waterWave];
[self.waterWave startWave];
seawater wave
1). seawater wave --> corresponding class YSCSeaGLView
tip: it should not run in simulator
self.seaGLView = [[YSCSeaGLView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];
[self.view addSubview:_seaGLView];
//hide
- (void)viewDidDisappear:(BOOL)animated
{
[_seaGLView removeFromParent];
_seaGLView = nil;
}
emitter animation
1). fire --> corresponding class YSCFireViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.view.backgroundColor=[UIColor whiteColor];
//设置发射器
_fireEmitter=[[CAEmitterLayer alloc] init];
_fireEmitter.emitterPosition=CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height-20);
_fireEmitter.emitterSize=CGSizeMake(self.view.frame.size.width-100, 20);
_fireEmitter.renderMode = kCAEmitterLayerAdditive;
//发射单元
//火焰
CAEmitterCell *fire = [CAEmitterCell emitterCell];
fire.birthRate=800;
fire.lifetime=2.0;
fire.lifetimeRange=1.5;
fire.color=[[UIColor colorWithRed:0.8 green:0.4 blue:0.2 alpha:0.1] CGColor];
fire.contents=(id)[[UIImage imageNamed:@"fire"] CGImage];
[fire setName:@"fire"];
fire.velocity=160;
fire.velocityRange=80;
fire.emissionLongitude=M_PI+M_PI_2;
fire.emissionRange=M_PI_2;
fire.scaleSpeed=0.3;
fire.spin=0.2;
fire.alphaSpeed = -0.05;
//烟雾
CAEmitterCell *smoke = [CAEmitterCell emitterCell];
smoke.birthRate=400;
smoke.lifetime=3.0;
smoke.lifetimeRange=1.5;
smoke.color=[[UIColor colorWithRed:1 green:1 blue:1 alpha:0.05] CGColor];
smoke.contents=(id)[[UIImage imageNamed:@"fire"] CGImage];
[smoke setName:@"smoke"];
smoke.velocity=250;
smoke.velocityRange=100;
smoke.emissionLongitude=M_PI+M_PI_2;
smoke.emissionRange=M_PI_2;
smoke.alphaSpeed = -0.05;
_fireEmitter.emitterCells=[NSArray arrayWithObjects:smoke, fire,nil];
[self.view.layer addSublayer:_fireEmitter];
}
2). butterfly --> corresponding class YSCButterflyViewController
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标移动开发之IOS频道!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号