Is it possible to controll the transition visual effect from the bottom for table search ?
I want to make this effect :
Finally this is was i did for this :
CATransition *transDown=[CATransition animation];
[transDown setDuration:0.1];
[transDown setType:kCATransitionPush];
[transDown setSubtype:kCATransitionFromTop];
[transDown setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[self.searchDisplayController.searchResultsTableView.layer addAnimation:transDown forKey:nil];
[self.search.layer addAnimation:transDown forKey:nil];
Related
How to switch different views in one view controller.I have to design a app that has five views in one view controller and the views contains some text fileds.if i fill the text fileds in first view it should enter to the another view.that another view contains text fields.
Try this in Objective-C
Switch view with animation
CATransition *transition = [CATransition animation];
transition.duration = 0.5;
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;
[transition setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[self.superView addAnimation:transition forKey:nil];
[self.superView addSubview:self.chieldView];
Actually you can do it by using container view with changing alpha of your (5 views) so when you are on first view its alpha becomes 1 while others will be 0 and so on
I've been scouring the web looking for examples of how I could incorporate animation into my UIWebView control but am coming up blank.
I am not picky as to the animation (I can mess with it once I understand how to attach it to the actions), I just want something more than just a stark transition from one web page to another, curled pages, animation from left (old page) to right (new page), whatever will do.
Can someone post an example or direct me to a page that explains how I might do this? I read the docs on CATransition but I still don't see how to incorporate it into my UIWebView navigation.
After some playing around I got the effect I wanted, I probably need to tweak it a bit but here's what I came up with:
Before performing a loadRequest (and I've changed my code for now so that I capture all page changes via shouldStartLoadWithRequest and then set the new page manually using webview loadRequest) I go to a curl animation routine I wrote called animatePage:
- (void) animatePage
{
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:1.0f];
animation.startProgress = 0.5;
animation.endProgress = 1;
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
[animation setType:#"pageCurl"];
//[animation setType:kcat];
[animation setSubtype:kCATransitionMoveIn];
[animation setRemovedOnCompletion:NO];
[animation setFillMode: #"extended"];
[animation setRemovedOnCompletion: NO];
[[myWebView layer] addAnimation:animation forKey:#"WebPageCurl"];
}
So to animate the page changes with a curling upward page animation I basically do:
[self animatePage];
[myWebView loadRequest:myRequest];
I can call the animatePage routine either before or after the loadRequest, it doesn't matter much.
I know this might not be the "right" way to get the job done but it does seem to get the job done. Like I said, I need to dial it in here and there but I'm happy with the result so far.
Using Swift:-
let animation = CATransition()//= [CATransition animation];
animation.delegate = self
animation.duration = 1.0
animation.startProgress = 0.5
animation.endProgress = 1
animation.timingFunction = CAMediaTimingFunction.init(name: kCAMediaTimingFunctionLinear)//kCAMediaTimingFunctionEaseInEaseOut)//kCAMediaTimingFunctionEaseOut
animation.type = "pageCurl"
animation.subtype = kCATransitionMoveIn
animation.isRemovedOnCompletion = false
animation.fillMode = "extended"
animation.isRemovedOnCompletion = false
webView?.layer.add(animation, forKey: "WebPageCurl")
I am trying to make a custom transition to push a view controller into the stack.
I dont know if there is an easy way to "lock" the navigationBar on its position and make the transition under the navigationBar.
I am using the following code:
CATransition *transition = [CATransition animation];
transition.duration = 0.3f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionMoveIn;
transition.subtype = kCATransitionFromBottom;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
First I tried the kCATransitionPush, but I could see the navigationBar moving down... so I tested kCATransitionMoveIn and it feels a bit better, but still not the way I wanted...
Is there a simple way to achieve this?
What you're doing is not how you do custom navigation controller transitions. You have to use the iOS 7 custom animator protocols (e.g. UIViewControllerAnimatedTransitioning).
I'm trying to watermark a video's elapsed time onto the video frames. But I could only render a static text using AVVideoCompositionCoreAnimationTool and CALayer into for the entire video duration.
How can I apply change the text that is overlaid on the video every second?
Similar questions in Stack Overflow hasn't been answered too
AVFoundation how to add watermark with specified time and
duration
How to watermark your video with different images and different
CMTimes using
AVFoundation
You can refer
http://www.raywenderlich.com/30200/avfoundation-tutorial-adding-overlays-and-animations-to-videos
you just need to CABasicAnimation and add your title layer to it. Just check it out to changing the needed parameters its working fine. I Have done it in my one of project
CATextLayer *title = [CATextLayer layer];
// code for title layer setting
// code for the opacity animation which will remove the text
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:#"opacity"];
[animation setDuration:0];
[animation setFromValue:[NSNumber numberWithFloat:1.0]];
[animation setToValue:[NSNumber numberWithFloat:0.0]];
[animation setBeginTime:1];
[animation setRemovedOnCompletion:NO];
[animation setFillMode:kCAFillModeForwards];
[title addAnimation:animation forKey:#"animateOpacity"];
Here I have html content which is displayed using UIWebView. The webview is displayed in horizontal scrolling and which looks like scrolling page by page and currently I have implemented the normal pagecurl animation,Instead of using this animation I want to use the UIPageviewcontroller
CATransition *transition = [CATransition animation];
[transition setDelegate:self];
[transition setDuration:0.5f];
if(flipType==0)
[transition setType:#"pageUnCurl"];
else {
[transition setType:#"pageCurl"];
}
[transition setSubtype:#"fromRight"];
[theWebView.layer addAnimation:transition forKey:#"CurlAnim"];
Could you help me to implement this.
Its really easy you could just have a webview as the view of the viewcontrollers added to the
pageviewcontroller
there is an excellent tutorial about the same
here
kindly go through it.