uiviewanimation

How to pause and resume UIView Animation?

假如想象 提交于 2019-11-28 10:26:53
I have a UIView with several UILabels that is animating from top to bottom and vice versa. A sort of Autoque let's say :) I use 2 functions: -(void)goUp -(void)goDown Those functions start a UIView animation to the required position.They both have an AnimationDidStopSelector defined that calls the other function at the end. This all works smoothly. When touching the screen, using touchesBegan, I would like to pause the current animation and change the vertical position of the UIView using touchesMoved event. In touchesEnded I want to resume the animation to the required end position. What

Android custom animation like airport schedule board

淺唱寂寞╮ 提交于 2019-11-28 09:24:26
I want to create an animation for the text like on Airport the flight schedule board does. Dropping from top and change the text on it. Here is the image. So When I click on button the text on the image should change with the said animation. Does it possible with android? Please guide me how can I achieve this kind of animation in android? EDIT: <?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:drawable="@drawable/clockbg1" android:duration="150" /> <item android:drawable="@drawable/clockbg2"

Creating slow scrolling to indexPath in UICollectionView

╄→гoц情女王★ 提交于 2019-11-28 08:18:34
I'm working on a project where I'm using a UICollectionView to create an 'image ticker' where I'm advertising a series of logos. The collectionView is one item high and twelve items long, and shows two to three items at a time (depending on size of the logos visible). I would like to make a slow automatic scrolling animation from the first item to the last, and then repeat. Has anyone been able to make this work? I can get the scrolling working using [myCollection scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:(myImages.count -1) inSection:0] atScrollPosition

Why are animations on bounds of an UILabel only working when increasing the size?

柔情痞子 提交于 2019-11-28 06:52:42
I noticed that when i change the bounds of an UILabel in an animation block it only works if i increase the size, when i decrease the size the UILabel just changes his size but doesn't animate. Replacing the UILabel with a plain UIView works as intended. Note: Changing the contentMode property of the UILabel to UIViewContentModeScaleToFill fixes this issue, but i still don't understand why it works when increasing the size without changing the contentMode property. #import "FooView.h" @interface FooView () @property (strong, nonatomic) UILabel *label; @property (assign, nonatomic) BOOL resized

Completion block for popViewController

∥☆過路亽.° 提交于 2019-11-28 02:52:08
When dismissing a modal view controller using dismissViewController , there is the option to provide a completion block. Is there a similar equivalent for popViewController ? The completion argument is quite handy. For instance, I can use it to hold off removing a row from a tableview until the modal is off screen, letting the user see the row animation. When returning from a pushed view controller, I would like the same opportunity. I have tried placing popViewController in an UIView animation block, where I do have access to a completion block. However, this produces some unwanted side

Is there a way to animate changing a UILabel's textAlignment?

好久不见. 提交于 2019-11-27 23:45:12
I am using iOS 7 and I am trying to move a label that is centered off to the left of my view. Currently I am trying to do this by changing how my UILabel is aligned, and I am trying to animate it in the process. I am currently calling the following: [UIView animateWithDuration:0.5 animations:^{ self.monthLabel.textAlignment = NSTextAlignmentLeft; } completion:nil]; But this just jumps the label to the new alignment. Is there a way to animate this, or a better way to adjust the label to make this happen? Set the UILabel frame size to exactly contain the text and center the UILabel in your view.

How to make half curl animation in iPhone like the maps app?

陌路散爱 提交于 2019-11-27 20:19:13
I am using the following code for page curl animation [UIView beginAnimations:@"yourAnim" context:nil]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:yourView cache:cacheFlag]; ... [UIView commitAnimations]; Is it possible to make the half curl animation like the maps.app on iphone/ipod ? Any ideas how to make an similar effect ? Thanks Apple does support this for the presentation of modal views as of 3.2. This makes sense: the page curl effect is intended to signal the user that a page of options or settings is being revealed, and when they are done changing things,

UIView animation jumps at beginning

萝らか妹 提交于 2019-11-27 20:04:17
I'm running this code... [UIView animateWithDuration:0.2 delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:^{ CGAffineTransform settingsTransform = CGAffineTransformMakeTranslation(self.settingsView.frame.size.width, 0); CGAffineTransform speedTransform = CGAffineTransformMakeTranslation(-self.speedView.frame.size.width, 0); self.settingsView.transform = settingsTransform; self.speedView.transform = speedTransform; } completion:nil]; But when it runs the views jump half the transform in the opposite direction before sliding to half a position in the correct direction. I've slowed

How to rotate image in Swift?

这一生的挚爱 提交于 2019-11-27 19:37:15
I am unable to rotate the image by 90 degrees in swift. I have written below code but there is an error and doesn't compile func imageRotatedByDegrees(oldImage: UIImage, deg degrees: CGFloat) -> UIImage { //Calculate the size of the rotated view's containing box for our drawing space let rotatedViewBox: UIView = UIView(frame: CGRect(x: 0, y: 0, width: oldImage.size.width, height: oldImage.size.height)) let t: CGAffineTransform = CGAffineTransform(rotationAngle: degrees * CGFloat(M_PI / 180)) rotatedViewBox.transform = t let rotatedSize: CGSize = rotatedViewBox.frame.size //Create the bitmap

Change duration (speed) on a running animation

谁说胖子不能爱 提交于 2019-11-27 19:21:18
问题 I am doing an indefinite rotation animation, which works perfectly well when I first start it. What I wanted to achieve was to be able to change the rate of rotation at the runtime. I have this function in animationView: -(void)startBlobAnimation:(float)deltaT { [UIView beginAnimations:@"Spinning" context:nil]; [UIView setAnimationCurve:UIViewAnimationCurveLinear]; [UIView setAnimationDuration:deltaT]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationRepeatCount:FLT_MAX];