iphone - 动画持续时间 : corrupts smooth progressbar increment

标签 iphone ios nsthread uiviewanimation uiprogressview

在我的一个 View 中,我需要为 UIImageView 的框架属性设置动画,同时我想在导航栏的标题 View 中显示进度条 (UIProgressView)。问题是如果我注释掉以下内容动画阻止进度条按预期顺利更新。另一方面,由于以下动画,进度条在多个位置停止并再次递增。

//add message bubble
[UIView animateWithDuration:0.3
                      delay:0
                    options:UIViewAnimationOptionAllowUserInteraction
                  animations:^
 {
     animationBubbleImageView.alpha = 1;
 }
                 completion:^(BOOL finished)
 {
     [self removeAutoCorrectionAndHighlight];
     [UIView animateWithDuration:0.3
                           delay:0
                         options:UIViewAnimationOptionAllowUserInteraction
                      animations:^
      {
          CGRect bubbleFrame = CGRectMake(animationBubbleImageView.frame.origin.x,
                                          animationBubbleImageView.frame.origin.y,
                                          bubbleSize.width,
                                          bubbleSize.height);

          [animationBubbleImageView setFrame:bubbleFrame];
          messageLabel.alpha = 1;
      }
                      completion:^(BOOL finished)
      {
          [self sendSubviewToBack:textView];
          [self.delegate moveBubbleToTableCell];
      }];
 }];

动画 block 不会阻塞主线程,但是进度 View 不流畅的原因可能是什么?

更新:我想要实现的是 IOS 中的 MessagesApp 气泡动画。当键入的消息变成气泡并飞到它的位置时,进度条应该缓慢增加。

如果我在没有动画进度条正常增加的情况下尝试同样的事情。

最佳答案

尝试把进度条动画和气泡动画放在同一个动画里。或者把他们都放到一个动画组里。

关于iphone - 动画持续时间 : corrupts smooth progressbar increment,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14564761/

相关文章:

iphone - touchesMoved 工作速度不够快

objective-c - 延迟发射一个动画

iphone - 如何在 iphone 中停止 NSThread 子线程

objective-c - MBProgressHUD 阻止用户交互

iOS 简单应用内用户反馈表

objective-c - NSThread VS pthreads

ios - 奇怪的 UITableView 错误 : "Assertion Failure" on dequeuing static cells in storyboard

iphone - 逐像素检查 UIImage

iphone - UITableView 有不同方向的不同行以及如何使可见单元格在旋转后显示相同的东西

iOS,自动布局为 iPhone 5 添加边距/间隔,但不是 iPhone 4?