core-animation

Could I get a basic explanation of CATransform3DIdentity?

倾然丶 夕夏残阳落幕 提交于 2019-12-19 02:34:06
问题 I am slowly getting more serious about Core Animation and would greatly appreciate an explanation composed of short words spoken (typed?) slowly explaining CATransform3DIdentity and why the following code does what it does (flips the layer around in '3D' space) kFaceUpTransform = kFaceDownTransform = CATransform3DIdentity; // Construct a 180-degree rotation matrix: kFaceDownTransform.m11 = kFaceDownTransform.m33 = -1; On second thought, type quickly and use multisyllabic words to your hearts

iphone Animation: why does rotating a UILabel around X axis cut off its bottom half?

房东的猫 提交于 2019-12-18 16:55:42
问题 I want to rotate a UILabel around the X axis, and animating it. But when the animation starts, the text of the label is cut in two, horizontally. The bottom half disappears, the upper half is rotating. Why? Here's the code: CATransform3D _3Dt = CATransform3DMakeRotation(radians(90.0f), 1.0, 0.0, 0.0); CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath:@"transform"]; transformAnimation.removedOnCompletion = NO; transformAnimation.toValue = [NSValue

Unwanted scrolling when animating zoomScale in UIScrollView

此生再无相见时 提交于 2019-12-18 15:55:25
问题 Executive Summary: At times UIScrollView makes an unwanted change to the value of contentOffset , thus causing the app to display the wrong location in the document being viewed. The unwanted change happens in conjunction to an animated change to the scroll view's zoomScale . The Details: I'm having trouble when zooming out with CATiledLayer in a UIScrollView . The CATiledLayer holds a pdf, and when contentOffset is within a certain range, when I zoom out, the contentOffset is changed (that's

iPhone: Drawing a curved line until it becomes a circle animation

徘徊边缘 提交于 2019-12-18 13:29:24
问题 I wish to draw a curved line until it makes a full rotation and joins to become a complete circle, just the circle outline, not filled. This has to be animated over a number of seconds. Can anyone point me in the right direction? I already asked a similar question to this but I worded it incorrectly so everyone had a hard time understanding what I meant and thus it got lost in the sea of questions. Many Thanks for any help [edit] I'm currently sub-classing UIView and overriding drawRect. I

iPhone - Jagged Edges when applying perspective to CALayer

大憨熊 提交于 2019-12-18 13:27:35
问题 I have a CALayer that I apply a perspective to using a CGTransform3D and specifying the m14 property. When the perspective is applied, the layer has jagged edges. I've heard people mention that adding a 1px transparent border around the layer will help with this. I don't know how to do that. I have tried using the border and borderWidth properties of a CALayer but the jagged edges are still there. I also tried to reduce the rect that is drawn by 1px on all sides, but it doesn't help either.

CAGradientLayer properties not animating within UIView animation block

早过忘川 提交于 2019-12-18 13:11:32
问题 I have a feeling I'm overlooking something elementary, but what better way to find it than to be wrong on the internet? I have a fairly basic UI. The view for my UIViewController is a subclass whose +layerClass is CAGradientLayer . Depending on the user's actions, I need to move some UI elements around, and change the values of the background's gradient. The code looks something like this: [UIView animateWithDuration:0.3 animations:^{ self.subview1.frame = CGRectMake(...); self.subview2.frame

UIImageView is disappearing after CAKeyframeAnimation

守給你的承諾、 提交于 2019-12-18 12:38:34
问题 I'm trying this code (found in an answer here on SO) in a category on UIView and am using it to peform a "pop" animation on a UIImageView nested inside of a UITableViewCell. - (void)attachPopUpAnimation { CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; CATransform3D scale1 = CATransform3DMakeScale(0.5, 0.5, 1); CATransform3D scale2 = CATransform3DMakeScale(1.2, 1.2, 1); CATransform3D scale3 = CATransform3DMakeScale(0.9, 0.9, 1); CATransform3D scale4 =

Most performant way to draw text on a curve, and animate it?

久未见 提交于 2019-12-18 12:38:11
问题 I'm guessing that it's to make a string out of individual CATextLayers and then position them as required along the curve, then animate. Because that's what's I've got working now, but it loses Kerning. Here's how: Why isn't my curved text centering itself? But is Core Text more performant and able to avoid the whole "drawing into a context" nonsense that slows everything down compared to the lean, mean Core Animation way of doing things, and respect kerning? i.e. avoiding drawRect: and all

How to animate UITableView header view

南笙酒味 提交于 2019-12-18 12:28:13
问题 I need to animate the insertion of a tableview header view. I want that the table rows to slide down while the header view expands its frame. So far the best result I got is by using the following code: [self.tableView beginUpdates]; [self.tableView setTableHeaderView:self.someHeaderView]; [self.tableView endUpdates]; The problem with this solution is that the header itself doesn't get animated, its frame doesn't expand. So the effect I'm getting is that the table rows slide down (as I want)

UIView “suck” animation

会有一股神秘感。 提交于 2019-12-18 12:28:06
问题 I'd like to use the UIView "sucking" transition (view is "sucked" into a point) referenced here: http://iphonedevwiki.net/index.php/UIViewAnimationState#Using_suckEffect The method above, however, uses private APIs, which makes it next to useless for an App Store app. How can I recreate a similar effect without relying on private APIs? I'm guessing the answer has to do with OpenGL, although I have zero experience there. 回答1: As long as Apple doesn't publicly document the effect, and you want