uiviewanimation

SubView slide in animation, iphone

江枫思渺然 提交于 2019-11-27 18:24:57
I have a UIview Containing two UIButtons. -(void)ViewDidLoad { geopointView = [[UIView alloc] initWithFrame:CGRectMake(0, 350, 120, 80)]; geopointView.backgroundColor = [UIColor greenColor]; UIButton *showGeoPointButton = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain]; showGeoPointButton.frame = CGRectMake(0, 0, 120, 40); showGeoPointButton.titleLabel.font = [UIFont systemFontOfSize:13.0]; [showGeoPointButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [showGeoPointButton addTarget:self action:@selector(showPlaces:) forControlEvents

Swap rootViewController with animation?

柔情痞子 提交于 2019-11-27 17:49:18
Im trying to swap to another root view controller with a tab bar; via app delegate, and I want to add transition animation. By default it would only show the view without any animation. let tabBar = self.instantiateViewController(storyBoard: "Main", viewControllerID: "MainTabbar") let appDelegate = UIApplication.shared.delegate as! AppDelegate appDelegate.window = UIWindow(frame: UIScreen.main.bounds) appDelegate.window?.rootViewController = tabBar appDelegate.window?.makeKeyAndVisible() That's how I swapped to another rootview controller. I evaluated UIView.transition(from: view, to: view)

I want to use animation to imageview using UIanimationtransitioncurl right or left. Is it possible?

血红的双手。 提交于 2019-11-27 14:55:47
I want to animate my photo gallery like the pages of the book. Is there any method with that I can use UIanimationtransitioncurl in either the left or right side? This is the code as you have suggested to me. I have done the allocation on the viewdidload method. self.title = @"TransitionsTitle"; // Create the container view which we will use for transition animation (centered horizontally). CGRect frame = CGRectMake(round((self.view.bounds.size.width - kImageWidth) / 2.0), kTopPlacement, kImageWidth, kImageHeight); self.containerView = [[[UIView alloc] initWithFrame:frame] autorelease]; [self

iOS - completion block in UIView animateWithDuration gets called too early

*爱你&永不变心* 提交于 2019-11-27 14:38:53
问题 I'm trying to do some animation when a table view cell gets selected. For some reason, the completion block is getting called way too early. Even setting the duration to 10 seconds, the completion block gets called immediately. [UIView animateWithDuration:10.0 animations:^{ message.frame = newFrame; } completion:^(BOOL finished) { NSLog(@"DONE???"); }]; Any thoughts on why this is happening? Thanks. 回答1: From the UIView documentation: completion A block object to be executed when the

How to stop and reverse a UIView animation?

妖精的绣舞 提交于 2019-11-27 12:25:00
问题 I have animated a UIView so that it shrinks when the user touches a toggle button and it expands back to its original size when the user touches the button again. So far everything works just fine. The problem is that the animation takes some time - e.g. 3 seconds. During that time I still want the user to be able to interact with the interface. So when the user touches the button again while the animation is still in progress the animation is supposed to stop right where it is and reverse.

How do I create a smoothly resizable circular UIView?

橙三吉。 提交于 2019-11-27 12:03:03
问题 I'm trying to create a UIView which shows a semitransparent circle with an opaque border inside its bounds. I want to be able to change the bounds in two ways - inside a -[UIView animateWithDuration:animations:] block and in a pinch gesture recogniser action which fires several times a second. I've tried three approaches based on answers elsewhere on SO, and none are suitable. Setting the corner radius of the view's layer in layoutSubviews gives smooth translations, but the view doesn't stay

Custom Segue Animation

戏子无情 提交于 2019-11-27 11:51:18
I am trying to use a custom segue to perform a kind of zoom animation. When the transition is executed, the sourceViewController goes black, then the zoom occurs. Tried also to set the pushViewController: into the completion block but the transition is not executed at all. - (void)perform { UIViewController *sourceViewController = (UIViewController *) self.sourceViewController; UIViewController *destinationViewController = (UIViewController *) self.destinationViewController; [destinationViewController.view setTransform:CGAffineTransformMakeScale(0.5,0.5)]; [destinationViewController.view

How to make UIView animation sequence repeat and autoreverse

不羁岁月 提交于 2019-11-27 10:48:13
How to make this complex animation repeat and autoreverse? Is there any way to add options UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat to this animation sequence? [UIView animateWithDuration:1.0f animations:^{ someView.frame = someFrame1; } completion:^(BOOL finished) { [UIView animateWithDuration:0.5f animations:^{ someView.frame = someFrame2; } completion:nil]; }]; To animation from point 1 to 2 to 3 to 2 to 1 and repeat, you can do use animateKeyframesWithDuration in iOS 7 and later: someView.frame = frame1; [UIView animateKeyframesWithDuration:2.0 delay:0.0 options

iOS: How to convert UIViewAnimationCurve to UIViewAnimationOptions?

*爱你&永不变心* 提交于 2019-11-27 10:26:35
问题 The UIKeyboardAnimationCurveUserInfoKey has a UIViewAnimationCurve value. How do I convert it to the corresponding UIViewAnimationOptions value for use with the options argument of +[UIView animateWithDuration:delay:options:animations:completion:] ? // UIView.h typedef enum { UIViewAnimationCurveEaseInOut, // slow at beginning and end UIViewAnimationCurveEaseIn, // slow at beginning UIViewAnimationCurveEaseOut, // slow at end UIViewAnimationCurveLinear } UIViewAnimationCurve; // ... enum { //

UIView animations with autoreverse

做~自己de王妃 提交于 2019-11-27 09:40:58
问题 I have a problem with the setting UIViewAnimationOptionAutoReverse . Here is my code. CALayer *aniLayer = act.viewToChange.layer; [UIView animateWithDuration:2.0 delay:1.0 options:(UIViewAnimationCurveLinear | UIViewAnimationOptionAutoreverse) animations:^{ viewToAnimate.frame = GCRectMake(1,1,100,100); [aniLayer setValue:[NSNumber numberWithFloat:degreesToRadians(34)] forKeyPath:@"transform.rotation"]; } completion:nil ]; The problem is that, after the animation has reversed, the view jumps