Tag: uianimation

如何在iOS中沿着弯曲的path移动视图

如何animation/移动曲线path中的视图,是否可以使用UIAnimation。 就像在图像中移动path中的视图一样。

iOS – animation效果 – 图像popup

我想在我的iPhone应用程序“popup”在屏幕上的图像,而不是只是出现。 “stream行”是指从一个小点到实际尺寸。 作为参考,这与Keynote中的“stream行”animation效果完全相同。 我对iOSanimation完全陌生,所以如果有人能指出我需要使用的animation效果的方向,那将不胜感激。 谢谢 布赖恩 更新我从下面的build议中添加了这个代码。 这有效,但它缩小了我的形象,而不是起来。 我知道这是因为我有0.01作为变换比例尺寸,但我想知道如何开始与一个大小为0.0的图像,并扩大到1。是只是一个问题来设置我的图像的大小0? 谢谢 [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration: 0.2]; image.transform = CGAffineTransformMakeScale(0.01, 0.01); [UIView setAnimationDelegate:self]; [UIView commitAnimations];

如何使动作识别器在animationUIImage视图中工作

我有一个图像视图中的5animation图像,并希望允许用户基于默认ID点击它们,并推到另一个视图。 我试图添加手势点击,但imageview没有检测到。 有人可以给我一些build议吗? 编辑:结束了我没有使用它,我设置了一个UIButton。 谢谢 :) viewDidLoad中 self.defaultID = [[NSMutableArray alloc] initWithObjects:@"7",@"9",@"11",@"27",@"6",nil]; self.defaultImageCaption = [[NSMutableArray alloc] initWithObjects:@"Ver",@"Green",@"Red",@"CF",@"Dwarf",nil]; //default image imageViewTop.alpha = 1.0; imageViewBottom.alpha = 0.0; imageViewBottom = [[UIImageView alloc] initWithFrame:CGRectMake(0,44,320,367)]; imageViewTop = [[UIImageView alloc] initWithFrame:CGRectMake(0,44,320,367)]; singleDefaultTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleDefaultTap:)]; singleDefaultTap.numberOfTouchesRequired = 1; imageViewTop.userInteractionEnabled = YES; [imageViewTop addGestureRecognizer:singleDefaultTap]; imageViewTop.tag = 2000; UIView *topView = [[UIView […]

transitionWithView和animateWithDuration的问题

我有transitionWithView和animateWithDuration问题。 我的animateWithDuration块之一不会转换,它是一个突然的变化,并且transitionWithView不会暂时禁用用户交互。 我已经检查了文档,并相信我正在做的一切正常,但显然有些事情是错的。 这里是两个代码块: 这是在我的主要视图控制器ViewController有三个容器视图/子视图控制器。 此块移动其中一个容器视图,但不会在转换发生时阻止ViewController其他交互。 [UIView transitionWithView:self.view duration:0.5 options:UIViewAnimationOptionCurveEaseOut animations:^ { CGRect frame = _containerView.frame; frame.origin.y = self.view.frame.size.height – _containerView.frame.size.height; _containerView.frame = frame; }completion:^(BOOL finished) { // do something }]; 这是在我的容器视图控制器之一。 animation似乎没有效果,因为productTitleLabel和productDescriptionTextView的文本突然变化,就好像animation块不存在一样。 – (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self.viewController toggleFlavoredOliveOilsTableView]; if (indexPath.row > 0) { NSDictionary *selectedCellDict = [[_flavoredOliveOilsDict objectForKey:@"Unflavored Olive Oils"] objectAtIndex:indexPath.row – […]

确定哪一个UIImageView显示的animationImages?

有没有办法找出它的animationUIImage是哪一帧? 当你启动它时,你给它一个animationImages数组,所以显然必须存储当前图像的索引。 你知道我怎么能find这个? 另外,有没有办法告诉UIImageView哪个框架开始animation?

UILabel的backgroundColor是不是animation?

我有一个gridView,我用来显示几个GridViewCell : UIView 。 GidViewCell将UILabel添加到自身,并将UITapGestureRecognizer到自身。 UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)]; [self addGestureRecognizer:gestureRecognizer]; [gestureRecognizer release]; 在tapped:我想玩一些animation,包括改变标签的背景颜色 – (void) tapped:(id)sender { [UIView animateWithDuration:1.0 delay:0 options:(UIViewAnimationOptionAllowUserInteraction) animations:^{ [(UILabel *)[[self subviews] objectAtIndex:0] setBackgroundColor:[UIColor blueColor]]; } completion:^(BOOL finished){ [(UILabel *)[[self subviews] objectAtIndex:0] setBackgroundColor:[UIColor whiteColor]]; } ]; [self.delegate didSelectGridViewCell:self]; } 但是,标签只是一眨眼的蓝色 – 如果有的话。 如果我使用相同的代码,但调整标签的alpha而不是背景颜色,一切都按预期工作。 苹果的文档列出backgroundColor作为animation。 是吗? 难道我做错了什么?

如何使用默认的iOS7 UIAnimation曲线

iOS7animation的行为与iOS6中的行为不同。 他们似乎使用不同的贝塞尔曲线。 在iOS6使用一种“easeInOutSine”曲线的情况下,iOS7更像是“easeInOutExpo”types。 ( http://matthewlein.com/ceaser/ ) 有没有办法使用这条曲线? 我想在键盘打开/closures时同步我的animation。

iOS翻译和缩放animation

我正在研究UIButtonanimation,其中: UIButton被设置在屏幕的底部中心,缩小到一个小的尺寸 _menuBtn.transform = CGAffineTransformMakeScale(0.1f, 0.1f); 当应用程序启动时,它应该移动到屏幕的左下angular,因为它会缩放或增长到原始大小。 – (void)viewDidLoad { [super viewDidLoad]; _menuBtn.frame = CGRectMake(160, 513, 30, 30); _menuBtn.superview.frame = CGRectMake(160, 513, 30, 30); _menuBtn.transform = CGAffineTransformMakeScale(0.1f, 0.1f); NSLog(@"_menuBtn: %@ ; _menuBtn.superview: %@", _menuBtn, _menuBtn.superview); [UIView beginAnimations:nil context:nil]; [UIView setAnimationDelegate:self]; [UIView setAnimationDuration:5]; [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; CGAffineTransform scaleTrans = CGAffineTransformMakeScale(1.0f, 1.0f); CGAffineTransform lefttorightTrans = CGAffineTransformMakeTranslation(-200.0f,0.0f); _menuBtn.transform = […]