从底部swift start tableView(反向tableView) [英] swift start tableView from bottom (reverse tableView)

查看:107
本文介绍了从底部swift start tableView(反向tableView)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以逆转tableView的顺序?我搜索了很多解决方案,但没有任何效果。

Is it possible to reverse order a tableView? I search a lot for a solution but nothing works.

效果就像是whatsapp聊天。

The effect is like whatsapp chat.

正常tableView是:

A normal tableView is:

----------
label 1
----------
label 2
----------
label 3
----------
empty
----------
empty
----------

scroll direction
   |
   |
   v

预期结果:

----------
empty
----------
empty
----------
empty
----------
empty
----------
label 3
----------
label 2
----------
label 1
----------

 scroll direction
      ^
      |
      |

感谢您的帮助

推荐答案

只需滚动到最后,每当插入一个单元格时都这样做。

Just scroll to the end and do the same whenever you insert a cell.

tableView.scrollToRowAtIndexPath(bottomIndexPath, atScrollPosition: .Bottom,
          animated: true)

这篇关于从底部swift start tableView(反向tableView)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆