catransform3d

UIView flip vertically

和自甴很熟 提交于 2021-02-06 15:10:52
问题 I know it's probably a dummy question, but I have to ask: How to flip a UIView vertically? I'm not asking for doing a animation, but just flip it. I can do vertical flip a UILabel by: label1.layer.transform = CATransform3DMakeRotation(M_PI, 1.0f, 0.0f, 0.0f); and turn it back by: label1.layer.transform = CATransform3DMakeRotation(M_PI, 0.0f, 0.0f, 0.0f); But when I'm doing it to a view: self.view.layer.transform = CATransform3DMakeRotation(M_PI, 1.0f, 0.0f, 0.0f); I think it only rotate half

CABasicAnimation - transform scale keep in center

旧巷老猫 提交于 2021-02-06 09:48:05
问题 Trying to animatie an ellipse masked on a UIView to be scale transformed remaining in the center position. I have found CALayer - CABasicAnimation not scaling around center/anchorPoint, and followed by adding a bounds property to the maskLayer CAShapeLayer however, this ends with the mask being positioned in the left corner with only 1/4 of it showing. I would like the mask to remain within the center of the screen. @synthesize maskedView; - (void)viewDidLoad { [super viewDidLoad];

iOS 13 CATransform3D issues

為{幸葍}努か 提交于 2020-01-25 06:49:09
问题 Prior to the release of iOS 13, I had had some CATransform3D code inside a UIView.animate block. In iOS 12, the result of the transformation animation looked like this: https://youtu.be/mfIzjjlKOBM. In iOS 13, the same transformation code now gives this result: https://youtu.be/hQdyGactIfA. As you can see in iOS 13 the animation is no longer a fluid cube movement like it is in iOS 12. Here's my basic code: UIView.animate(withDuration: duration, delay: 0, options: .curveEaseOut, animations: {

Origami transition using CATransform3D perspective

狂风中的少年 提交于 2020-01-22 04:32:07
问题 I'm trying to achieve a kind of origami transition on two UIView using only layer capabilities. The idea is to fold two views with a perspective effect. Both views have a perspective, the transition is defined by a rotation on each view, as well as a translation on one view such that this view seems to be attached to the other one. The issue is that the view overlaps one another in the middle of the transition. I don't want to use a zPosition to visually avoid this overlapping, I really want

CATransform3DRotate effects gone after applying anchor point

空扰寡人 提交于 2020-01-16 04:43:28
问题 EDIT with correct observation. I used the following two snippets to rotate an UIImageView. After the stage1, I got the desired 3D effect: the view rotate (3D effect) and stretched out (larger size). On stage2, I am trying to swing the rightView with the hinge on the right. If I applied the line that changes the anchor point, the view swings correctly (hinge on right) with one major issue: The view's size got restored back to original size (smaller) while the (rotation) 3D effect is still

Approximate rect after applying CATransform3D?

一曲冷凌霜 提交于 2020-01-16 04:10:07
问题 I applied CATransform3D to a view. How can I find its approximate new frame after it? I mean I applied a complex transform: rotation, translation, scale and perspective. And I need to find something like approximate minimal rect. I need it because this view is added to UIScrollView (to know the contentSize I need and of course to implement "scrollToItem:") 回答1: If you want to get the CGRect that completely contains this transformed view, you can use convertRect:toView: . For example: CGRect

Rotating Two UIImageView in X Direction

送分小仙女□ 提交于 2020-01-14 03:15:08
问题 i wanna rotate two images i put one images behind the other but when i rotate them with the following code the back image will be above the front image and i assign their ZPOstion but their is no change this link for my view before rotate http://i39.tinypic.com/ivv2ah.png and after rotate http://i43.tinypic.com/ic05xj.png how this happen [UIView animateWithDuration:0.2 animations: ^{ CALayer *myLayer=self.image2.layer; CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@

Using CATransform3D to create flip animation

爷,独闯天下 提交于 2020-01-13 13:11:14
问题 I'm trying to recreate UIViewAnimationTransitionFlipFromRight (and left). My reason for doing so, as shown below, is to make changes to AVCaptureVideoPreviewLayer in the middle of the animation, when the layer is obstructed. UIViewAnimationTransitionFlipFromRight won't let me stop the animation half way, make session changes, and continue, so here is my best shot at it. While this works, it's just not the same as UIViewAnimationTransitionFlipFromRight. The layer starts to rotate, but more of

Using CATransform3D to create flip animation

穿精又带淫゛_ 提交于 2020-01-13 13:11:14
问题 I'm trying to recreate UIViewAnimationTransitionFlipFromRight (and left). My reason for doing so, as shown below, is to make changes to AVCaptureVideoPreviewLayer in the middle of the animation, when the layer is obstructed. UIViewAnimationTransitionFlipFromRight won't let me stop the animation half way, make session changes, and continue, so here is my best shot at it. While this works, it's just not the same as UIViewAnimationTransitionFlipFromRight. The layer starts to rotate, but more of

Using CATransform3D to create flip animation

纵然是瞬间 提交于 2020-01-13 13:11:05
问题 I'm trying to recreate UIViewAnimationTransitionFlipFromRight (and left). My reason for doing so, as shown below, is to make changes to AVCaptureVideoPreviewLayer in the middle of the animation, when the layer is obstructed. UIViewAnimationTransitionFlipFromRight won't let me stop the animation half way, make session changes, and continue, so here is my best shot at it. While this works, it's just not the same as UIViewAnimationTransitionFlipFromRight. The layer starts to rotate, but more of