core-animation

Animate the mask of a mask of a CALayer

时光怂恿深爱的人放手 提交于 2019-12-13 12:36:24
问题 Goal: I am drawing a custom shape that has a gradient. I also want to animate the drawing of this shape by having it draw in from left to right. Problem: The code below works on an iPad simulator, but it doesn't work on my iPad 4 running iOS 7. Does anyone know how to make this work on the device? Is there a different way to achieve this same result? Explanation of my Code: My code works (only on simulator) using 3 CALayers. gradientLayer holds my gradient. shapeMaskLayer holds my custom

How to get the actual size of transformed CALayer?

懵懂的女人 提交于 2019-12-13 12:05:47
问题 I have a 200x200 pixel CALayer instance to which I've applied two transformations: scaled down to 50% applied a 3D perspective Now I want to align the transformed layer with another layer. To do that I need the size (width and height) of the transformed layer. The problem is that layer.bounds still returns 200x200 for the layer, but because of the perspective transformation the actual visible width is less and the height more than 200 . The bounds of the presentation layer return 0 , by the

IOS - multiple images going slowly upward animation

醉酒当歌 提交于 2019-12-13 07:47:14
问题 i am new to IOS programming. what i want is i want to show multiple images and then they go upward continuously and then repeat again and again in sort of a loop. how can i do this ? i have total 8 images which i want to show like this i don't know how can i add 8 images and then they go upward direction verically continuously repeating. please help me in this. if there is any tutorial related to that and then please share 回答1: You should not do it this way. If you make your step value small

Animating UILabel Fade In/Out

天大地大妈咪最大 提交于 2019-12-13 06:41:51
问题 I am going to end up with an array of RSS feeds, and would like a label or some such to display them at the bottom of the view. I would like to animate through each feed in the array. This is what i have so far to animate, which, works for the fade, but only animates the last item of the array. feed = [[UILabel alloc] initWithFrame:CGRectMake(0,380,320,43)]; [self.view addSubview:feed]; feed.alpha=1; NSArray *feeds = [NSArray arrayWithObjects:[NSString stringWithFormat:@"1234567"],[NSString

iPhone Xs Max: AVCaptureVideoPreviewLayer when added to sublayer of View occupies less than the safe area of the iphone x - why?

孤街浪徒 提交于 2019-12-13 06:36:22
问题 I am trying to build a custom camera using a single view application with the new iPhone Xs Max. With reference to the screenshot below, it can be seen that the video output displayed in AVCaptureVideoPreviewLayer occupies less than the safe area of the screen on the iPhone x. How do I calculate the space that has not been occupied? How do I know that the AVCaptureVideoPreviewLayer occupies less than the safe area? Well, the top border of the top 'Button' is anchored to the top border of the

Animating a view created in IB using Autolayout

懵懂的女人 提交于 2019-12-13 04:10:08
问题 I have a view with a lot of labels and buttons which are created on code because in IB is too complicated. This works ok. In IB I also created an input view which I want to appear from the bottom by the tap on a button. Very much like a keyboard if you will. Because this input view is strigth forward, it has been created on IB and it contains sliders, labels, etc. I haven't added it as a subview of self.view on IB. By the tap of the button, I set up all the constrains for the input view: I

How to add an animated layer at a specific index

余生长醉 提交于 2019-12-13 03:39:46
问题 I am adding two CAText layers to a view and animating one of them. I want to animate one layer above the other but it doesn't get positioned correctly in the layer hierarchy until the animation has finished. Can anyone see what I have done wrong? The animation works, it is just running behind 'topcharlayer2' until the animation has finished. - (CABasicAnimation *)topCharFlap { CABasicAnimation *flipAnimation; flipAnimation = [CABasicAnimation animationWithKeyPath:@"transform"]; flipAnimation

Why is an empty drawRect interfering with a simple animation?

会有一股神秘感。 提交于 2019-12-13 01:40:42
问题 I'm trying to put together my own take on Cocoa's NSPathControl . In a bid to figure out the best way to handle the expand-contract animation that you get when you mouse over a component in the control, I put together a very simple sample app. Initially things were going well - mouse into or out of the view containing the path components and you'd get a simple animation using the following code: // This code belongs to PathView (not PathComponentView) override func mouseEntered(theEvent:

Rotation always start from original position

妖精的绣舞 提交于 2019-12-12 22:51:45
问题 I am trying to implement a wheel type functionality. I calculate the center point of the view and find the angle created on moving in touchesMoved: method. For the first move it rotated by some degree. But for next move it comes back to the original position of the view and then rotating.Actually i want the rotation from the end point of the previous rotation. Any thing missing?Any help - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { float a, b,c; UITouch *aTouch = [touches

Fish Eye Effect With Core Animation?

偶尔善良 提交于 2019-12-12 21:16:03
问题 I am trying to achieve an effect similar to the globe of the ABC News iPad app. (Google Images Examples) Is it possible to get this effect by transforming CALayers? Or is this using OpenGL and fragment/vertex shaders? CALayer provides access to the transformation matrix, is there some math that can be applied to this rather than transforming the OGL model view matrix? Feels like OGL is the more complicated way to do this and that there should be an easier solution. If anyone has some ideas it