How to create animation of round rows of UIView?

I want to create a UIView animation similar to this link

Cpp3 css3 effect example

I tried all these codes in ViewDidLoad () and didn't work

UIView *view = [[UIView alloc] initWithFrame:CGRectMake(200, 200, 100, 100)]; view.backgroundColor = [UIColor blueColor]; CATransition *animation=[CATransition animation]; [animation setDelegate:self]; [animation setDuration:1.75]; [animation setTimingFunction:UIViewAnimationCurveEaseInOut]; [animation setType:@"rippleEffect"]; [animation setFillMode:kCAFillModeRemoved]; animation.endProgress=1; [animation setRemovedOnCompletion:NO]; [view.layer addAnimation:animation forKey:nil]; [self.view addSubview:view]; 

I want to create the same thing in iOS. Please help me

+4
source share
2 answers

The following lines of your code look great:

 CATransition *animation=[CATransition animation]; [animation setDelegate:self]; [animation setDuration:1.75]; [animation setTimingFunction:UIViewAnimationCurveEaseInOut]; [animation setType:@"rippleEffect"]; [view.layer addAnimation:animation forKey:nil]; 

But the problem is that you apply the animation before adding the view to your supervisor. which obviously won't work!

Try to add a preview, then apply the animation. I also expect this to not work.

if you add this view to your supervisor in the viewDidLoad method. apply the animation in the ViewDidAppear or ViewWillAppear methods.

Otherwise, create a separate method that applies the animation. and call it after adding the subset by calling the performSelector:withObject:afterDelay .

+4
source

Hope this helps you example class

UIView + Glow is a category in UIView that adds support for creating a glow of views (useful for highlighting parts of the screen to encourage the user to interact with it).

To find out why it can be used and how to use it, check out the message

+1
source

All Articles