This question is locked. New answers and comments are not allowed.
when i try to animate a size change of the chart it just changes to the final value without animation, every thing else (background and other views) changes animated but the chart is not.
I tried 3 different ways to animate:
1.Constraints:
widthConstraint.constant = 200;
heightConstarint.constant=200;
[UIView animateWithDuration:0.5 animations:^{
[self.view layoutIfNeeded];
}];
2. Frame change:
[UIView animateWithDuration:0.5 animations:^{
_chart.bounds = CGRectMake(0, 0, 200, 200);
}];
3. Layer change:
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"bounds.size"];
animation.duration = 0.5;
animation.toValue = [NSValue valueWithCGSize:CGSizeMake(200, 200)];
[_chart.layer addAnimation:animation forKey:@"sizeAnimation"];
Help.
I tried 3 different ways to animate:
1.Constraints:
widthConstraint.constant = 200;
heightConstarint.constant=200;
[UIView animateWithDuration:0.5 animations:^{
[self.view layoutIfNeeded];
}];
2. Frame change:
[UIView animateWithDuration:0.5 animations:^{
_chart.bounds = CGRectMake(0, 0, 200, 200);
}];
3. Layer change:
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"bounds.size"];
animation.duration = 0.5;
animation.toValue = [NSValue valueWithCGSize:CGSizeMake(200, 200)];
[_chart.layer addAnimation:animation forKey:@"sizeAnimation"];
Help.