core-animation

Animate AVPlayerLayer videoGravity property

回眸只為那壹抹淺笑 提交于 2019-12-18 12:08:26
问题 I'm trying to copy Apple's behavior in video playback that allows the user to stretch the video image to fill the bounds. @interface FHVideoPlayerView : UIView @end @interface FHVideoPlayerView + (Class)layerClass { return [AVPlayerLayer class]; } - (void)setAspectMode:(FHVideoPlayerAspectMode)aspectMode animated:(BOOL)animated { FHVideoPlayerAspectMode current = [self aspectMode]; FHVideoPlayerAspectMode final = aspectMode; NSString *fromValue; NSString *toValue; AVPlayerLayer *layer =

How can I present a UIView from the bottom of the screen like a UIActionSheet?

泪湿孤枕 提交于 2019-12-18 12:04:26
问题 I'd like a UIView to slide up from the bottom of the screen (and stay mid-screen) like a UIActionSheet. How can I accomplish this? UPDATE: I am using the following code: TestView* test = [[TestView alloc] initWithNibName:@"TestView" bundle:nil]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.4]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; test.view.center = CGPointMake(160,100); //test.view.frame = CGRectMake(0, 0, 160, 210); [[[UIApplication

Core animation animating the layer to flip horizontally

家住魔仙堡 提交于 2019-12-18 12:03:36
问题 I have two views and I want to switch between the two view using core animation, animating the layer of each of the views. The animation I want is like the one provided by UIViewAnimationOptionTransitionFlipFromLeft but I could not manage to do it. I could make the layer rotate 180 and then when the animation stop I transition to the next view. How can this be done? I used the code as below: CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"]; self.view.layer

Tracking a Core Animation animation

此生再无相见时 提交于 2019-12-18 11:53:30
问题 I have two circles which move around the screen. The circles are both UIViews which contain other UIViews. The area outside each circle is transparent. I have written a function to create a CGPath which connects the two circles with a quadrilateral shape. I fill this path in a transparent CALayer which spans the entire screen. Since the layer is behind the two circular UIViews, it appears to connect them. Finally, the two UIViews are animated using Core Animation. The position and size of

How to replicate the Scale Up Animation when an app starts regularly (push app icon on HomeScreen) on an iPhone

戏子无情 提交于 2019-12-18 11:43:19
问题 i want to replicate the animation when an app starts on iPhone. There is the first view scaling up from 50 % to 100% i think. later I want to use this as a transition between 2 views. Any ideas how to replicate, or is there a ready to use solution from apple in the sdk? Thank you very much :) 回答1: You can do the same thing with CABasicAnimation and CAAnimationGroup, I actually thought that Core Animation over UIKit Animations was smoother and It gives you more control. CAAnimationGroup

Reg: modifying layer that is being finalized… [CALayer frame]: message sent to deallocated instance 0xe43c520

时光毁灭记忆、已成空白 提交于 2019-12-18 11:39:42
问题 I am stuck with a very strange issue. I hope that many of you can provide me input to solve this. My application breaks quite often, but I am not able to get the exact scenario. In Log I get following 2011-02-10 16:22:12.914 RCA-iOS[4132:8327] modifying layer that is being finalized - 0xe43c520 2011-02-10 16:22:13.253 RCA-iOS[4132:207] modifying layer that is being finalized - 0xe43c520 2011-02-10 16:22:13.270 RCA-iOS[4132:207] modifying layer that is being finalized - 0xe43c520 2011-02-10 16

Resize and move a UIView with Core Animation (CAKeyFrameAnimation)

。_饼干妹妹 提交于 2019-12-18 11:35:46
问题 Is this possible? I can change the opacity and position (center) of the layer but whenever I try to change the size or origin, it doesn't work. CAAnimationGroup* anigroup = [CAAnimationGroup new]; CGMutablePathRef thePath = CGPathCreateMutable(); CGPathAddRect(thePath, NULL, CGRectMake(0,0, 320, 480)); CGPathAddRect(thePath, NULL, CGRectMake(location.x - 16,location.y-24, 32, 48)); CGPathAddRect(thePath, NULL, CGRectMake(190, 20, 32, 48)); CAKeyframeAnimation* AniLoc = [CAKeyframeAnimation

CoreAnimation warning deleted thread with uncommitted CATransaction

烂漫一生 提交于 2019-12-18 10:46:35
问题 I am having issues with the following warning: CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces. I am using an NSOperation object to perform some calculations, once complete it sends a message back to the AppDelegate that then hides a progress bar and unhides some buttons. If I comment out the message back to the AppDelegate the warning goes away but the progress bar obviously remains visible and animated. I am

Cropping UIImage like camscanner

只谈情不闲聊 提交于 2019-12-18 10:45:00
问题 I am stuck in my application feature. I want cropping feature similar to Cam Scanner Cropping. The screens of CAM-SCANNER are: I have created similar crop view. I have obtained CGPoint of four corners. But How can I obtained cropped image in slant. Please provide me some suggestions if possible. 回答1: This is a perspective transform problem. In this case they are plotting a 3D projection in a 2D plane. As, the first image has selection corners in quadrilateral shape and when you transform it

What's the difference between a CoreAnimation Layer Backed View and a Layer Hosting View?

本秂侑毒 提交于 2019-12-18 10:27:27
问题 What is the difference between a Layer Backed View and a Layer Hosting View in Core Animation? What are the steps to setting up each and when is it appropriate to use either type? 回答1: A layer backed view contains Cocoa or Cocoa Touch UI controls and can be animated using the animator proxy. Layer backed views allow you to animate your UI and help to reduce the overhead of drawing by caching the views contents on a core animation layer. Create a Layer backed view by setting the wants layer