您可以使用以下UITableView
dataSource
方法來指定動畫
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
let frame = cell.frame
cell.frame = CGRectMake(0, self.tableView.frame.height, frame.width, frame.height)
UIView.animateWithDuration(1.0, delay: 0.0, options: UIViewAnimationOptions.TransitionCrossDissolve, animations: {() -> Void in
cell.frame = frame
}, completion: nil)
}
在objc
-(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *) cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
CGRect frame = cell.frame
[cell setFrame:CGRectMake(0, self.tableView.frame.height, frame.width, frame.height)];
[UIView animateWithDuration:1.0 delay:0 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
[cell setFrame:frame];
} completion:^(BOOL finished) {
}];
}
修改動畫,以滿足您的需要
添加一些代碼。 – iOS