water effect in a view based application

≡放荡痞女 提交于 2019-12-05 05:14:22

问题


I'm using a view based application in xcode and I would like to do an effect: water effect like this video .In this video the guy use opengl es And I don't know it it's possible without.


回答1:


Following code is use for the water drop effect,

-(IBAction)btnActionTapped:(id)sender{
    CATransition *animation=[CATransition animation];
    [animation setDelegate:self];
    [animation setDuration:1.75];
    [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
[animation setType:@"rippleEffect"];

    [animation setFillMode:kCAFillModeRemoved];
    animation.endProgress=0.99;

        imgV.hidden=YES;
        imgV2.hidden=NO;


    [animation setRemovedOnCompletion:NO];
    [self.view.layer addAnimation:animation forKey:nil];
}


来源:https://stackoverflow.com/questions/9377427/water-effect-in-a-view-based-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!