Questions tagged [cgaffinetransformscale]

71 questions
88
votes
15 answers

Scale UIButton Animation- Swift

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…
AaoIi
  • 8,288
  • 6
  • 45
  • 87
21
votes
2 answers

Animation Grow/Decrease Size imageView iOS

I'm trying to animate a custom button using CGAffineTransformMakeScale as follows: if (stateButton == 0) { //The button is gonna appear self.selected = YES; self.imageView.transform = CGAffineTransformMakeScale(0.01, 0.01); [UIView…
9
votes
2 answers

UIView: how to "reset" transformations. CGAffineTransformScale not working as I would expect

I think my question can be summed up as how to store and reset the transform of a view. But then perhaps explaining my situation might help. If I apply the transforms below to a view, one after another (like if I add this code to a switch or a…
OWolf
  • 5,012
  • 15
  • 58
  • 93
8
votes
3 answers

iOS view transform animation

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 …
8
votes
1 answer

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

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…
OWolf
  • 5,012
  • 15
  • 58
  • 93
7
votes
3 answers

Swift CGAffineTransformScale to a scale, not by a scale

Let's say I scale a UILabel using a CGAffineTransformScale like so: let scale = 0.5 text = UILabel(frame: CGRectMake(100, 100, 100, 100)) text.text = "Test" UIView.animateWithDuration(2.0, delay: 0.0, options: UIViewAnimationOptions.CurveEaseIn,…
satvikb
  • 319
  • 1
  • 3
  • 17
6
votes
2 answers

CGAffineTransformMakeScale animation on a cornerRadius rounded UIButton

I am rounding a UIBUtton, which is fine (self is a uibutton subclass): self.layer.cornerRadius = self.frame.size.width/2; self.layer.masksToBounds = YES; self.clipsToBounds = YES; But I am also trying to animate the button to shrink the scale…
Daniel McCarthy
  • 1,406
  • 2
  • 13
  • 19
5
votes
0 answers

Swift: how to implement a resizable personalized uiview with four buttons at vertexes

I would like to implement a resizable and draggable UIView like the following picture shows: This is the class I have implemented up to now using simple gestures recognizers: class PincherView: UIView { var pinchRec:UIPinchGestureRecognizer! var…
SagittariusA
  • 5,289
  • 15
  • 73
  • 127
5
votes
0 answers

UIView CGAffineTransform scale issue (autolayout issue?)

I am trying to apply a simple CGAffineTransform to an imageView by scaling to 0, but for some reason the frame of the imageView is getting screwed up just before the animation starts. It appears as though autolayout is applying to the shrunken view.…
devios1
  • 36,899
  • 45
  • 162
  • 260
4
votes
5 answers

Apply CGAffineTransformScale to UIView makes the layer border go bigger too

I have a UIView, inside it I have a UIImageView. I have a UIPinchGestureRecognizer added to the UIVIew to handle the pinch and zoom and make the UIView grow with the UIImageView altogether. My UIView has a border. I added the border this way:…
Andres
  • 11,439
  • 12
  • 48
  • 87
4
votes
2 answers

How to keep a consistent 2px border around a UIView when scaling it?

I have a custom UIView that is able to be scaled and rotated based on the values of a UISlider. Scaling is working well, it's simply: self.myView.transform = CGAffineTransformScale(CGAffineTransformIdentity, sx, sy); My UIView has a 2px…
Andrew Davis
  • 2,310
  • 1
  • 24
  • 43
4
votes
2 answers

Applying a Scale AffineTransform to a UIView changes its center

I'm running this code to shrink a UIView when the user taps on its superview. However, when applying the CGAffineTransformScale(), it also changes the centre. Is that the expected behaviour? -(void) onTap:(UITapGestureRecognizer *)tap{ [UIView…
4
votes
2 answers

CGAffineTransformScale modified after device rotation

I have a view that I am performing a transform on originalTransform = self.appContainer.transform; self.appContainer.transform = CGAffineTransformMakeScale(.8, .8); If I do not rotate the device I can revert this back to the original by…
MobileOverlord
  • 4,580
  • 3
  • 22
  • 30
4
votes
1 answer

Correcting blurry text after a CGAffineTransformMakeScale

I have multiple views with many UILabels on the views. (all constructed in Interface Builder). I am then trying to create a "smaller" replica of my view when you pinch the screen. To do this I apply: view.transform = CGAffineTransformMakeScale(.5,…
Adam Johnson
  • 2,198
  • 1
  • 17
  • 23
3
votes
1 answer

Video Merging Orientation in Swift

I am using video merging tutorial in that in ray wenderlich. I always get an 90 degree rotated video.When I add some different caffeine rotation codes my videos can t seen. Can you advise me I code that include CGAffineTransformMakeRotation. My…
1
2 3 4 5