开发者

Smooth out resizing table cells during reload on rotation

I have a project that includes a table that is dynamically created and formatted without using IB. The issue is, that the table needs to change both values and size during a rotation. However, the resizing is choppy and occurs suddenly during the animation. Currently I'm using the did开发者_JS百科Rotate method, and in that method I'm calling the reload method in order to resize it. Should I be using a different method to do this, or is there anyway to at least smooth out the resizing?

Edit: I'm trying to use the replacement/resizing within the willRotateToInterfaceOrientation:, or possibly the two step animation. However, these methods are never called, is this due to the view hierarchy (the view I'm trying to resize is part of a split view)?


Do you tell the didRotate method to use animation when making the changes? For example, here is a code snippet that makes a flip transition. The key is to use the "beginAnimations" and "commitAnimations" to tell the iPhone how to handle those changes. The code in between describes the changes. When the "commitAnimations" is called, the changes are magically animated.

[UIView beginAnimations:@"leftPortrait" context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:1.0f];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:leftView cache:YES];
[leftWebView setFrame:CGRectMake(0, 0, 384, 916)];
[UIView commitAnimations];

Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜