Wednesday, 18 September 2013

UIView animation code working fine in iOS6 but not in iOS7

UIView animation code working fine in iOS6 but not in iOS7

I have a UIAnimation code which increases the height of a UITableview as
below
-(void) viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
NSLog(@"%f",[summaryTableview frame].size.height);
if([UIScreen mainScreen].bounds.size.height == 568)
{
[UIView animateWithDuration:0.0 delay:0
options:UIViewAnimationOptionBeginFromCurrentState animations:^{
CGRect tableviewRect = [summaryTableview frame];
[summaryTableview setFrame:CGRectMake(tableviewRect.origin.x,
tableviewRect.origin.y, tableviewRect.size.width,
tableviewRect.size.height + 80)];
} completion:^(BOOL finished) {
NSLog(@"%f",[summaryTableview frame].size.height);
}];
}
}
I am checking if the current device is iPhone5 and if so, I am increasing
the UITableview called SummaryTableview to fill in the extra height. This
piece of code works as expected in iOS6 but the tableview is not getting
extended in iOS7.
Any suggestion will be helpful.Thank you
Update: iOS 6: First NSLog logs 358 and second NSLog logs 438 iOS 7: First
NSLog logs 358 and second NSLog logs 358
As you can notice second NSLog is inside animation completion block.

No comments:

Post a Comment