1,想做一个会话界面,进来的时候滑动到最底部。
2,但是滑动到最底部的代码 使用之后,并没有滑动到最底部,总是差一截。
3,并不是那种底部有一段不能滑动上来的那种错误,是可以滑动上来的,就是在进来这个view的时候,不能直接滑动到最底部
4,这是我的代码
let indexPath = NSIndexPath(forRow: self.chatMessageModel.contentType.count-1, inSection: 0)
self.scrollToRowAtIndexPath(indexPath, atScrollPosition: .Bottom, animated: false)
5,这张图是我进会话的view之后的样子
6,这张图红框标出的就是tableView下面还有一小段 没有滑动到底的
问:谁知道为什么会这样么?
Is the input field below covering the content below? Try setting contentOffset or contentInset.
The row of indexPath is wrong, right?
Should we set the attribute automaticallyAdjustsScrollViewInsets? The height doesn’t look like 64 either
Make sure the tableView frame is OK
Make sure tableView reload is complete
Try scroll to contentOffset (max,max)
This allows the Tableview to directly display the following
This is OC code, just find the same method in Swift.
I guess it is
You reset the tableView’s frame in viewWillAppear; you can print “tableView’s frame” here
Also check if the row height is correct.
If not, set ContentOffset
Has the problem been solved? I also encountered the same problem and I don’t know how to solve it
Have you solved it? I also encountered the same problem
How to solve this problem