core-animation

Objective C iPad Animation with large images - What method to use?

北城以北 提交于 2019-12-14 03:49:20
问题 I'm trying to build a weather application on the iPad but it seems that I need some help in animation. Say I'm animating a Radar, so the radar source files have 10 gif/jpeg pictures in 900x700 pixel size. I've tried the UIImage animation technique using the tutorial here: http://www.icodeblog.com/2009/07/24/iphone-programming-tutorial-animating-a-game-sprite/ but it seems that loading 10 images that big is too much for the iPad to handle and its crashing due to memory warnings. I'm

iOS - Rotate a layer right and left using two different UIButtons

喜夏-厌秋 提交于 2019-12-14 03:19:22
问题 I created a layer using CALayer and animated it using CABasicanimation with rotate animation and created two TouchDown UIButtons to rotate it left and right, I got a problem when the layer rotates right it gets back to the original angle and the same with left rotation Here's my code: -(void)viewDidLoad { //Button 1 UIButton *aButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; aButton.frame = CGRectMake(0, 0, 145, 145); aButton.center = CGPointMake(90, 190); aButton.backgroundColor =

How do you create a wiggle animation similar to iphone deletion animation

落花浮王杯 提交于 2019-12-14 03:00:25
问题 We are currently developing an application that contains a series of icons. We want the icons to wiggle like the app deletion animations when pressed. What would be the best way to code this animation sequence? 回答1: The answer by Vinzius is very cool. However the wobble only rotates from 0 Radians to 0.08. Thus the wobble can look a little unbalanced. If you get this same issue then you may want to add both a negative and a positive rotation by using a CAKeyframeAnimation rather than a

Is this code, for horizontal page curl in iPhone, valid?

为君一笑 提交于 2019-12-14 02:35:37
问题 I was Googling for applying horizontal page curl in iPhone. I also tried this, but it wasn't appropriate for me (To change orientation and work in different ori.). I tried to search the web more. Finally I got this link. From where, I could understand the horizontal page curl. But when I went to code deeply, I found some confusing points: extern NSString *kCAFilterPageCurl; // From QuartzCore.framework is it valid to use internal variable ? ( as it's mentioned - from QuartzCore ) CAFilter

iOS: How to animate a flip between two UIViews?

心不动则不痛 提交于 2019-12-14 00:27:42
问题 I am trying to animate a flip effect between a UIButton instance and a UIImageView instance. Basically it's a "flip over a playing card" effect, one side (UIImageView) is just a nice pattern and when flipped, it should show a UIButton with some text. My code features the following problems: the text of the UIButton sub-view is not shown after flipping the shadow disappears during the flip animation Here's a visual representation of the goal: Here you can download the very simple sample app.

Does the -presentationLayer tell me the in-flight values of an view while it is beeing animated?

本秂侑毒 提交于 2019-12-13 20:18:29
问题 The doc says: presentationLayer Returns a copy of the layer containing all properties as they were at the start of the current transaction, with any active animations applied. And somewhere else Apple said, that the presentation layer contains the values like they are currently displayed to the user. So when I ask for this layer, why would it tell me how the thing looked before starting to animate? That doesn't make sense. Is that an documentation error? 回答1: The documentation is correct.

UIView animation clips view bounds. Any way to prevent clipping?

我的梦境 提交于 2019-12-13 16:28:30
问题 I have a UIView animation that does a vertical flip animation transition from one view to another. The problem is that the view has some overflowed content (achieved by setting clipsToBounds to NO on the view), and during the animation, the overflowed content gets clipped. Is there any way to prevent CoreAnimation from clipping the views? Screenshots Normal view (notice the paperclip and overhanging rope along the top edge of the map): Animation in flight: (paperclip and rope are clipped) 回答1

How to properly animate sequentially using CAAnimation

情到浓时终转凉″ 提交于 2019-12-13 15:53:37
问题 I'm simply closing doors, delaying 2 sec/calling a method then opening them back. One comes from the left side and the other from the right side. I first used UIView animation block but then realized whenever user leaves the app during animation, its completion block would never get called. I could not find anyone complaining about such behavior when interruption happens during animation thus could not solve the problem and now I'm hoping CAAnimation's animationDidStop or CATransaction's

Why NSWindow animator setFrame:display:animate: didn't work sometimes?

你说的曾经没有我的故事 提交于 2019-12-13 15:24:22
问题 I'm new to Cocoa. And I'm working on extending a project's function. The original function of that project is open a file and display the file icon in a nsbox(which is in nswindow?) And when I click the menu to open, it works fine. But when I open the file programmatically(using the same openfile function which the menu called), it don't show the file icon. [[self.window animator] setFrame:frame display:YES animate:YES]; the frame is correct, but it doesn't changed. Is there anything I missed

Core Animation - animationDidStop not called

我们两清 提交于 2019-12-13 14:32:20
问题 there. in iOS app, Core animation callback don't work. - (void)startAnim { CABasicAnimation* anim = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; anim.fromValue = startAngle; anim.toValue = endAngle; anim.duration = 2; anim.delegate = self; [self.target addAnimation:anim forKey:nil]; // self.target is CALayer instance, it's sublayer of Custom UIView } - (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag { [self.target setValue:@(endAngle) forKeyPath:@