cgaffinetransformscale

iOS view transform animation

我是研究僧i 提交于 2019-12-30 04:32:23
问题 I'm probably missing something simple, but trying to do a simple "Ken Burns Effect" with an image view. First the code: [UIView animateWithDuration:20 delay:2 options:UIViewAnimationCurveLinear animations:^{ CGAffineTransform move = CGAffineTransformMakeTranslation(40, 40); CGAffineTransform zoom = CGAffineTransformMakeScale(1.2, 1.2); CGAffineTransform transform = CGAffineTransformConcat(zoom, move); self.imageView.transform = transform; } completion:^(BOOL finished){ NSLog(@"Done"); }]; I

Setting affine transform on NSView layer not working as on iOS

倖福魔咒の 提交于 2019-12-23 02:07:17
问题 I am trying to achieve something very simple. I would like to transform a layer's scale. However it does not seem to work as expected. In fact, it does not work at all. The layer's scale remains the same. Here is my code: NSView *v = [[NSView alloc]init]; v.wantsLayer = YES; v.frame = self.bounds; float scale = 0.8f; [v.layer setAffineTransform:CGAffineTransformMakeScale(scale,scale)]; [self addSubview:v]; If I log the affineTransform property of v I get null . 回答1: Try this on OSX: self

Gesture recognizers and auto-layout in iOS6, scaling from the center

删除回忆录丶 提交于 2019-12-21 04:29:32
问题 This gesture recognizer code below, which normally would scale a view from the center, does not when auto-layout is enabled in iOS6. The view seems to scale from it's origin when auto layout is enabled. Other affine transformations (particularly scale and rotate) are also not working as I expected. Anyone have this issue, or can enlighten me to the right way to handle this? - (IBAction)handlePinch:(UIPinchGestureRecognizer *)recognizer { recognizer.view.transform = CGAffineTransformScale

Gesture recognizers and auto-layout in iOS6, scaling from the center

大兔子大兔子 提交于 2019-12-03 12:44:50
This gesture recognizer code below, which normally would scale a view from the center, does not when auto-layout is enabled in iOS6. The view seems to scale from it's origin when auto layout is enabled. Other affine transformations (particularly scale and rotate) are also not working as I expected. Anyone have this issue, or can enlighten me to the right way to handle this? - (IBAction)handlePinch:(UIPinchGestureRecognizer *)recognizer { recognizer.view.transform = CGAffineTransformScale(recognizer.view.transform, recognizer.scale, recognizer.scale); recognizer.scale = 1; } With Autolayout you

iOS view transform animation

左心房为你撑大大i 提交于 2019-11-30 13:52:55
I'm probably missing something simple, but trying to do a simple "Ken Burns Effect" with an image view. First the code: [UIView animateWithDuration:20 delay:2 options:UIViewAnimationCurveLinear animations:^{ CGAffineTransform move = CGAffineTransformMakeTranslation(40, 40); CGAffineTransform zoom = CGAffineTransformMakeScale(1.2, 1.2); CGAffineTransform transform = CGAffineTransformConcat(zoom, move); self.imageView.transform = transform; } completion:^(BOOL finished){ NSLog(@"Done"); }]; I expected this to start with the image view at normal scale and expand it to 120% of the size over 20

Scale UIButton Animation- Swift [closed]

Deadly 提交于 2019-11-29 18:56:33
I'm trying to do scale animation for UIButton when its clicked but what I'm trying to accomplish is when the button clicked I need the UIButton to be smaller to the inside then it comes back to its same size (like a bubble). I tried the following: button.transform = CGAffineTransformMakeScale(-1, 1) UIView.animateWithDuration(0.5, animations: { () -> Void in button.transform = CGAffineTransformMakeScale(1,1) }) Try this UIView.animate(withDuration: 0.6, animations: { self.button.transform = CGAffineTransform(scaleX: 0.6, y: 0.6) }, completion: { _ in UIView.animate(withDuration: 0.6) { self

CGAffineTransformScale not working with zero scale

守給你的承諾、 提交于 2019-11-29 08:10:53
Updating to iOS 8 and I've noticed an interesting one. I use CGAffineTransformScale to scale an image view to zero, the idea being that it disappears from the user's view neatly. It's work up to iOS8 but now it's not at all. Instantly the view is gone; blank! So originally I used: CGAffineTransform zoom = CGAffineTransformScale(CGAffineTransformIdentity, 0.0f, 0.0f); myImageView.transform = zoom; Why would this which worked up to now not work and when the functions haven't been depreciated? rob mayoff A CGAffineTransform is a 3x3 matrix, with its rightmost column permanently set to (0, 0, 1) T

Scale UIButton Animation- Swift [closed]

眉间皱痕 提交于 2019-11-28 14:12:21
问题 I'm trying to do scale animation for UIButton when its clicked but what I'm trying to accomplish is when the button clicked I need the UIButton to be smaller to the inside then it comes back to its same size (like a bubble). I tried the following: button.transform = CGAffineTransformMakeScale(-1, 1) UIView.animateWithDuration(0.5, animations: { () -> Void in button.transform = CGAffineTransformMakeScale(1,1) }) 回答1: Try this UIView.animate(withDuration: 0.6, animations: { self.button

CGAffineTransformScale not working with zero scale

纵饮孤独 提交于 2019-11-28 01:41:18
问题 Updating to iOS 8 and I've noticed an interesting one. I use CGAffineTransformScale to scale an image view to zero, the idea being that it disappears from the user's view neatly. It's work up to iOS8 but now it's not at all. Instantly the view is gone; blank! So originally I used: CGAffineTransform zoom = CGAffineTransformScale(CGAffineTransformIdentity, 0.0f, 0.0f); myImageView.transform = zoom; Why would this which worked up to now not work and when the functions haven't been depreciated?