core-animation

Revolving animation, that follows finger, of uibuttons that follows outer path of circle

江枫思渺然 提交于 2019-12-01 23:30:25
I am looking for a little guidance to start figuring out an animation that tracks finger movement and moves a collection of UIButtons along the outer path of a circle I am picturing it will kind of have a revolver feel to it. Like each one locks into place at the bottom or like the swiping through one of the slide inserts of these thanks in advance (Sample code on GitHub ) It's not really that difficult, there's just a lot of trigonometry involved. Now, what I'm going to describe now, is not an animation , since you requested for it to track the position of your finger in the title. An

Animate a custom property using CoreAnimation in Monotouch?

时光毁灭记忆、已成空白 提交于 2019-12-01 23:28:33
This is essentially the same question as posted here: Animating a custom property in a CALayer over a year ago and hasn't been answered. Im creating a custom layer and drawing a circle on it. I'd like to be able to animate the radius of the circle (and other properties later). From what i've read, i've set it up like so: public class CircleLayer : CALayer { //[Export("radius")] //public float Radius { get;set; } //EDIT: I've now changed the radius field to what is coded below public float Radius; [Export("radius")] public float getRadius() { return Radius; } [Export("setRadius:")] public void

Using Core animation to animate StrokeColor

可紊 提交于 2019-12-01 21:07:41
I'm trying to animate CAShapeLayar's strokeColor property. I looked throught the documentation and it was stated that it is an animatable property. The code is working for animating postion.y but not the the strokeColor. I'll be happy to get any kind of help or advice The code I've used: lyr.fillColor = [[UIColor clearColor] CGColor]; lyr.lineWidth = 3.8; lyr.strokeColor = [[UIColor yellowColor] CGColor]; lyr.position = CGPointMake(160, 431); lyr.anchorPoint = CGPointMake(.5f, .5f); [self.view.layer addSublayer:lyr]; CABasicAnimation *basicAnimation = [CABasicAnimation animationWithKeyPath:@

sequencing image using core animation, Recieving memory warnings

与世无争的帅哥 提交于 2019-12-01 20:25:44
问题 I am recieving memory warning using 100 of animating images so I tried to use Core Animation instead but that gives me the same problem. This is because I don't know how to use replaceSublayer in my current code UIView* upwardView=[[UIView alloc]init]; [upwardView setFrame:CGRectMake(0, 0, 1024, 768)]; [self.view addSubview:upwardView]; NSArray *animationImages=[NSArray arrayWithObjects:[UIImage imageNamed:@"001.png"],[UIImage imageNamed:@"001.png"],[UIImage imageNamed:@"002.png"],[UIImage

Unable to setContentOffset in scrollViewDidEndDragging

南楼画角 提交于 2019-12-01 20:16:42
I am attempting to modify the contentOffset of my scroll within the following delegate method: - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate I have tried both of the following: [UIView animateWithDuration:.2 animations:^ { [scrollView setContentOffset:CGPointZero animated:NO]; }]; and [UIView animateWithDuration:.2 animations:^ { CGRect svBounds = self.bounds; svBounds.origin.y = 0; self.bounds = svBounds; }]; The problem is that although this changes the offset right away (proven by logs after the animation is complete), it doesn't change the

sequencing image using core animation, Recieving memory warnings

你离开我真会死。 提交于 2019-12-01 19:15:53
I am recieving memory warning using 100 of animating images so I tried to use Core Animation instead but that gives me the same problem. This is because I don't know how to use replaceSublayer in my current code UIView* upwardView=[[UIView alloc]init]; [upwardView setFrame:CGRectMake(0, 0, 1024, 768)]; [self.view addSubview:upwardView]; NSArray *animationImages=[NSArray arrayWithObjects:[UIImage imageNamed:@"001.png"],[UIImage imageNamed:@"001.png"],[UIImage imageNamed:@"002.png"],[UIImage imageNamed:@"003.png"],....,nil]; CAKeyframeAnimation *animationSequence = [CAKeyframeAnimation

How do I animate opacity using swift?

不羁的心 提交于 2019-12-01 18:01:07
Could someone please provide me with an example of animating the opacity of an Image View in swift?? I couldn't even find a good example in objective c func showCorrectImage(element: AnyObject){ var animation : CABasicAnimation = CABasicAnimation(keyPath: "opacity"); animation.delegate = self animation.fromValue = NSValue(nonretainedObject: 0.0) animation.toValue = NSValue(nonretainedObject: 1.0) animation.duration = 1.0 element.layer?.addAnimation(animation, forKey: nil) } I think I have most of this right (not completely sure though), could someone please help me? element = an Image View

CAEmitterLayer not rendering when -renderInContext: of superlayer is called

不羁岁月 提交于 2019-12-01 17:39:07
I have a drawing app and I would like for my users to be able to use particle effects as part of their drawing. Basically, the point of the app is to perform custom drawing and save to Camera Roll or share over the World Wide Web. I encounted the CAEmitterLayer class recently, which I reckon would be a simple and effective way to add particle effects. I have been able to draw the particles onscreen in the app using the CAEmitterLayer implementation. So rendering onscreen works fine. When I go about rendering the contents of the drawing using CGContextRef context =

Disable animation when moving CALayers

£可爱£侵袭症+ 提交于 2019-12-01 16:49:52
The following code animates the movement, even though I didn't use beginAnimations:context . How do I get it to move without animating? This is a new iphone view project, and these are the only updates to it. // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; sublayer = [CALayer new]; sublayer.backgroundColor = [[UIColor redColor] CGColor]; sublayer.frame = CGRectMake(0, 0, 100, 100); [self.view.layer addSublayer:sublayer]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { sublayer.position

Disable animation when moving CALayers

浪尽此生 提交于 2019-12-01 16:37:18
问题 The following code animates the movement, even though I didn't use beginAnimations:context . How do I get it to move without animating? This is a new iphone view project, and these are the only updates to it. // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; sublayer = [CALayer new]; sublayer.backgroundColor = [[UIColor redColor] CGColor]; sublayer.frame = CGRectMake(0, 0, 100, 100); [self.view.layer