Programmaticlaly在UITableView中移动带有动画的行 [英] Programmaticlaly moving rows with animation in UITableView
本文介绍了Programmaticlaly在UITableView中移动带有动画的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用酷动画效果将一行移动到 UITableView
的底部,就像 this Grocery Shopping List app 。
就像我们可以通过重新排序移动行控制类似:
如何创建这样的动画?
解决方案
使用以下 UITableView
选择器:
- (void)moveRowAtIndexPath :(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath
例如:
[self.tableView moveRowAtIndexPath:indexPath toIndexPath:[NSIndexPath indexPathForRow:[items count] - 1 inSection:1]
I want to move a row to the bottom of my UITableView
with cool animation effect just like in this Grocery Shopping List app.
Just like we can move rows with reordering control like:
How can I create such animation?
解决方案
In IOS 5 this can be done with the following UITableView
selector:
- (void)moveRowAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath
For example:
[self.tableView moveRowAtIndexPath:indexPath toIndexPath:[NSIndexPath indexPathForRow:[items count] - 1 inSection:1]];
这篇关于Programmaticlaly在UITableView中移动带有动画的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文