core-animation

fliping view continiously

ぐ巨炮叔叔 提交于 2019-12-12 04:37:13
问题 this my code [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1.5]; if ([sender tag] == 1) { [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:placeholder cache:YES]; } else { [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES]; } if (view1OnTop) { [view1 removeFromSuperview]; [placeholder addSubview:view2]; } else { [view2 removeFromSuperview]; [placeholder addSubview:view1]; } [UIView

Changing UILabel position to strokeEnd of CGPath

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 04:17:35
问题 I'm trying to achieve something similar to the attached image, where the circle is animated depending on your level progress and then a label is attached to both the end of the animated path to show the gained experience and also the undrawn part of the circle to show the remaining experience. I have the circle animating as wanted but am having trouble coming up with a solution to the labels to appear in the right spot. I've tried setting the position of the label to the path.currentPoint but

Wait until animation finishes before moving on Swift

别等时光非礼了梦想. 提交于 2019-12-12 03:58:39
问题 In the following code, how do I wait until the animation is done before moving on? I want the code to pulse "Sending" twice and "Sent" once, but it goes straight to "Sent", as far as I can tell" UIView.animateWithDuration(1.0, delay: 0.25, options: UIViewAnimationOptions.CurveEaseIn, animations: { self.countdownLabel.alpha = 0.0 }, completion: nil) countdownLabel.text = "Sending" UIView.animateWithDuration(1.0, delay: 0.25, options: UIViewAnimationOptions.CurveEaseIn, animations: { self

Why isn't my curved text centering itself?

╄→гoц情女王★ 提交于 2019-12-12 03:58:23
问题 I have a UIView subclass called dpCurvedLabel . It uses CATextLayers to curved text around an arc. It works fine, except that I can't get it perfectly centered in the layers parent view. I want the center point for the arc to be at the very center of the view (even if the view is smaller) so all the text characters are the same distance from the center. I can get it CLOSE but it's always a at least few pixels off. The amount it's 'off' seems to be effected by the frame size I give each

Why do UIView & UIImageView animate differently?

时间秒杀一切 提交于 2019-12-12 03:56:02
问题 I have 4 buttons, all use the same animate func imageViewWithoutDelay imageViewWithDelay ViewWithoutDelay ViewWithDelay my code: import UIKit class ViewController: UIViewController { @IBAction func imageViewithoutDelay(_ sender: AnyObject) { let circleImage = UIImageView() // kindly add your own image. circleImage.image = UIImage(named: "empty") animate(inputView: circleImage, delay: false) } @IBAction func imageViewWithDelay(_ sender: UIButton) { let circleImage = UIImageView() circleImage

How do I make a layer maintain the final value of a CABasicAnimation

隐身守侯 提交于 2019-12-12 03:42:43
问题 Consider the following animation: CABasicAnimation *pathAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; pathAnimation.duration = 1.0; pathAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; pathAnimation.fromValue = [NSNumber numberWithFloat:0.0f]; pathAnimation.toValue = [NSNumber numberWithFloat:1.0f]; pathAnimation.removedOnCompletion = NO; pathAnimation.delegate = self; This will essentially animate the drawing of the layer

Pulling animation on ios

ε祈祈猫儿з 提交于 2019-12-12 02:56:43
问题 Please i need to know how can i do pulling effect using multiple image. Those images must follow a specific path each image beside another one like a train. is there any solution than looping. what i wanna exactly is those image move simultaneously. 回答1: You want to use a CAKeyFrameAnimation, using a CGPath to describe the path you want your objects to follow. You would create a series of animations, each using the same path, but with different beginTimes. The tricky bit is how to use

Resize animations on a scrollview

只愿长相守 提交于 2019-12-12 02:49:08
问题 I am trying to create a resize toggle animation on this simple custom TUIScrollView class (from TwUI open source project and very similar to UIScrollView) that I have built. It is called TUILayout and supports horizontal layout as well as vertical, animated insertions and removals and has a more declarative way of supplying data to it's cells that I prefer over delegation. It recycles views similar to TUITableView or UITableView. Anyway if you want to follow along, it's just one class and is

app starts ignores user interaction events when i call animateWithDuration:delay:options:animations:completion:

元气小坏坏 提交于 2019-12-12 02:48:16
问题 I have a button that glows in my app (subclass of UIButton). To animate the glowing i use the following method - (void)glow { [UIView animateWithDuration:1.0f delay:0.0f options:UIViewAnimationOptionCurveEaseInOut animations:^(void){ if (glowingImageView_.alpha != 1.0f) { [glowingImageView_ setAlpha:1.0f]; } else { [glowingImageView_ setAlpha:0.3f]; } } completion:^(BOOL finnished){ if (on_) { [self glow]; } }]; } It works fine running on iOS 5, but in iOS 4.3 my app stops handling any user

Core Animation Warning: “uncommitted CATransaction”

余生颓废 提交于 2019-12-12 01:34:23
问题 I am getting the following warning with Device only: CoreAnimation: warning, deleted thread with uncommitted CATransaction; created by: 0 QuartzCore 0x3763c65d <redacted> + 220 1 QuartzCore 0x3763c541 <redacted> + 224 2 QuartzCore 0x3763fe2f <redacted> + 30 3 QuartzCore 0x3763b9bf <redacted> + 318 4 QuartzCore 0x3763b87b <redacted> + 50 5 QuartzCore 0x3763b80b <redacted> + 538 6 MyApp 0x000df597 -[CommonClass orangeGradient:] + 382 7 MyApp 0x000f70e1 -[HomeViewController updateStatusBar] +