私は持っていUITableView
ます。セルがテーブルに読み込まれているときにアニメーションを作成したい。こんな感じにします。
-(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
CGRect tmpFrame;
CGRect originalFrame;
originalFrame = cell.frame;
tmpFrame = cell.frame;
tmpFrame = CGRectMake(0, -50, 320, 50);
cell.frame = tmpFrame;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:5.0f];
[UIView setAnimationBeginsFromCurrentState:YES];
UIView* separatorLineView = [[UIView alloc] initWithFrame:CGRectMake(0, 50, 320, 1)];
separatorLineView.backgroundColor = [UIColor lightGrayColor];
[cell.contentView addSubview:separatorLineView];
cell.frame = originalFrame;
[UIView commitAnimations];
}
このコードはiOS6(iPhoneシミュレーター6)では正常に機能しますが、iOS 5.1(iPhoneシミュレーター5.1)では機能しません。