【问题标题】:water effect in a view based application基于视图的应用程序中的水效果
【发布时间】:2012-03-11 18:08:06
【问题描述】:

我在 xcode 中使用基于视图的应用程序,我想做一个效果:像这样的水效果video 。在这个视频中,这个人使用 opengl es 我不知道没有它是可能的。

【问题讨论】:

    标签: iphone xcode uiview effects distortion


    【解决方案1】:

    以下代码用于水滴效果,

    -(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];
    }
    

    【讨论】:

    • 什么是yepNop=YES;确切地 ? :)
    • 这用于显示视图标志使用
    • 您能简要解释一下 imgV 和 imgV2 是什么数据类型以及为什么需要将它们设置为隐藏吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多