Allows the UIView to be moved elastically and the UIView to be moved elastically.

Source: Internet
Author: User

Allows the UIView to be moved elastically and the UIView to be moved elastically.
Enable UIView to move elastically by Wu xueying

[UIView animateWithDuration:1 delay:0.0 usingSpringWithDamping:0.5 initialSpringVelocity:0 options:UIViewAnimationOptionLayoutSubviews animations:^{        _moveView.top = 400;    } completion:^(BOOL finished) {        _moveView.top = 100;}];



Does Objective-C have a UIView animation? How can I slide a view from the top of the screen?

Animated: YES, that is, enable the animation effect. All programs written in Objective-c are run on the console. animation is available in IOS. As for moving the view, this is certainly okay. Write a function to change the origin of the view frame or the center point. Use a timer to trigger the function. After the timer is triggered, the coordinates are incremented until the target coordinates are reached and the timer is stopped. 44 more. After learning for a long time, you will naturally know, don't worry

How can images be moved at a constant speed?

Solve the problem. paste the code CGPoint point = CGPointFromString ([PointArray objectAtIndex: number]); float durationTime = [self distanceBetweenTwoPoint: protagonist. center point2: point]/MOVE_VELOCITY; [UIView animateWithDuration: durationTime delay: 0 opti *****: Refreshing animati *****: ^ {[UIView setAnimationCurve: Unknown]; protagonist. center = point;} completion: ^ (BOOL finished) {if (finished) {int currentPointNumber = number + 1; [self protagonistMove: PointArray protagonist: protagonist number: currentPointNumber] ;}}] ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.