uiviewanimation

iPhone: How to commit two animations after another

浪尽此生 提交于 2019-12-23 04:00:17
问题 This is an absolute beginner's question (sorry), but I was wondering how to commit one animations and once it has ended to start another one. Imagine having an image moved from x=0 to x=300. Then you want to do animate the same image again, but this time from x=300 to x=330 so that it disappears from the screen. The following code will only do the animation from x=300 to x=330 and will not commit the animation x=0 to x=300. I'm sure I don't get the concept of commitAnnimation and that this is

iOS - How to slow down UISlider animation?

社会主义新天地 提交于 2019-12-23 02:43:14
问题 I'm trying to slow down the animation of the UISlider when changing values. So far, I've tried the old UIView animation method: [UIView beginAnimations:@"slider" context:nil]; [UIView setAnimationDuration:5.0]; [self.slider setValue:2 animated:YES]; [UIView commitAnimations]; And the new blocks based method: [UIView animateWithDuration:5.0 animations:^{ [self.slider setValue:2 animated:YES]; }]; I've tried with and without the animated:YES value set. In all cases, the slider simply animates

Swift-animate CAshapeLayer stroke color

情到浓时终转凉″ 提交于 2019-12-22 12:20:44
问题 I'm trying to find a way to animate the color of the stroke that I am creating circleLayer = CAShapeLayer() circleLayer.path = circlePath.CGPath circleLayer.lineCap = kCALineCapRound circleLayer.fillColor = UIColor.clearColor().CGColor CABasicAnimation fill = CABasicAnimation. circleLayer.strokeColor = UIColor(red: 0.4, green: 1.0, blue: 0.2, alpha: 0.5).CGColor circleLayer.lineWidth = 20.0; circleLayer.lineJoin = kCALineJoinRound // Don't draw the circle initially circleLayer.strokeEnd = 0.0

How to animate preferredContentSize when using UIPopoverPresentationController?

夙愿已清 提交于 2019-12-22 08:47:06
问题 I am able to successfully change the frame of a popover I present by simply setting preferredContentSize . I would now like to animate the change in the content size but I haven't been successful. It just instantly updates, in fact the delay I have set isn't even respected. How could one animate the change in content size? //In viewDidAppear: UIView.animateWithDuration(5, delay: 3, usingSpringWithDamping: 0.5, initialSpringVelocity: 0.25, options: UIViewAnimationOptions.CurveEaseInOut,

When is it appropriate to use Core Animation over UIView animation in common cases

ε祈祈猫儿з 提交于 2019-12-22 07:58:08
问题 This is related to a lot of little bugs that might stereotypically be considered minor by one person, but major by another. What I've noticed more and more, is that when using all flavors a UIView animateWithDuration: , it actually modifies things unnecessarily, such multiple properties of my views', to do a simple hide/reveal style animations, etc.. Things seem to be finicky in scenarios like a UINavigationBar not animating into position properly for a certain rotation transition, or a

Strange behavior when animating UITextField

主宰稳场 提交于 2019-12-22 06:47:10
问题 I'm trying to animate a UITextField but I've been caught by a annoying and strange problem. My animation has the following sequence: In first state the application has the UITextField , the camera UIButton and the cancel UIButton after the camera button that is not been showed because it is been positioned out of the limits of the application. Actually my application has 320 of width and the cancel button origin is (350,7) In second state, when user touches on UITextField , the camera button

User interaction on an animated UIButton

北城以北 提交于 2019-12-22 06:00:05
问题 I am trying to make a little application in Xcode 4.2 targeting the iPhone. What I want is a UIButton that animates down the screen, and when you press it, you set it's alpha to 0. I found a method from the UIView class that was able to deal with user interactions, and came to this code: [UIView animateWithDuration:3.0 delay:0 options: UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionAllowAnimatedContent animations: ^{ CGRect myRect = enemy1.frame; myRect.origin.y = 300;

How do I animate child view controllers when adding to/removing from a container view controller?

孤街浪徒 提交于 2019-12-22 04:36:26
问题 I have the following 2 functions that add and remove child view controllers triggered from a container view controller: @discardableResult func addChildViewController(withChildViewController childViewController: UIViewController) -> UIViewController { // Add Child View Controller addChildViewController(childViewController) childViewController.beginAppearanceTransition(true, animated: true) // Add Child View as Subview view.addSubview(childViewController.view) // Configure Child View

UIButton inside a UIView not working after UIView is animated

本小妞迷上赌 提交于 2019-12-22 03:41:19
问题 I have seen many questions in this forum which gives answer to this topic "UIButton inside a UIView, when animated doesn't work", but after having tried out the answers like a) UIViewAnimationOptionAllowUserInteraction to the options b) subView.setUserInteractionEnabled = YES c) [button addTarget:self action:@selector(buttonPressed) forControlEvents:UIControlEventTouchUpInside]; none of them is working for me :-( Here is the scenario. App is in landscape mode and a UIView called menuView is

iOS curl up animation to remove uiimageview

穿精又带淫゛_ 提交于 2019-12-21 20:22:17
问题 i'm looking to remove an image from my app with a curl up animation. I've got [UIView transitionWithView:sender.view.superview duration:1.5 options:UIViewAnimationOptionTransitionCurlUp animations:^ { [sender.view removeFromSuperview]; } completion:nil]; but this curls the entire page away and looks as though there's a separate page beneath without the image on it. Instead of a 'transition' to a new page is it possible to curl the image off the page without affecting the rest of the page? Do