Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

animateWithDuration: corrupts smooth progressbar increment

In one of my views i need to animate frame property of a UIImageView and while doing it i want to show a progress bar(UIProgressView) in the title view of the navigation bar.The problem is the if i comment out the following animation blocks the progress bar is updated as expected smoothly.On the other hand due to the following animation the progress bar stops in severals places and carries incrementing again.

//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];
      }];
 }];

animation blocks do not block the main thread but what coudl be the reason of unsmooth beahviout of th progress view ?

UPDATE: What i want to achive is the MessagesApp bubble animation in IOS.While the typed message becomes a bubble and flies to its place the progress bar should increment slowly.

If i try the same thing withou animation progressbar increments normal.

like image 640
Ilker Baltaci Avatar asked Jan 28 '13 14:01

Ilker Baltaci


1 Answers

Try putting the progress bar animation in the same animation as the bubble animation. Or put them all into an animation group.

like image 155
Dad Avatar answered Sep 26 '22 21:09

Dad