swift uitableview显示cell最后一列
2015-05-16 13:23
1306 查看
类似qq聊天的效果。每发一条信息,tableview更新cell并且显示最后一个cell
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell") as! UITableViewCell
var sectionCount:Int = self.tableViewMessInfo.numberOfSections()
if(sectionCount != 0) {
var rowCount = self.tableViewMessInfo.numberOfRowsInSection(0)
if(rowCount != 0)
{
println("\\\\\\\\\\\\\\\\\\")
var ii = [0, rowCount - 1]
var indexPath = NSIndexPath(indexes: ii, length: ii.count)
self.tableViewMessInfo.scrollToRowAtIndexPath(indexPath, atScrollPosition: UITableViewScrollPosition.Bottom, animated: true)
}
}
return cell
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell") as! UITableViewCell
var sectionCount:Int = self.tableViewMessInfo.numberOfSections()
if(sectionCount != 0) {
var rowCount = self.tableViewMessInfo.numberOfRowsInSection(0)
if(rowCount != 0)
{
println("\\\\\\\\\\\\\\\\\\")
var ii = [0, rowCount - 1]
var indexPath = NSIndexPath(indexes: ii, length: ii.count)
self.tableViewMessInfo.scrollToRowAtIndexPath(indexPath, atScrollPosition: UITableViewScrollPosition.Bottom, animated: true)
}
}
return cell
}
相关文章推荐
- swift uitableview 中实现分组,将cell分组显示,类似微信的好友界面
- Swift UITableView相关功能(三)设置每行显示的内容
- iOS设置UITableView的背景图片,以及不显示多余的空Cell
- UITableView中复用cell显示信息错乱
- UITableView (3):显示cell上的菜单
- 使用storyboard显示UITableView时,如果不修改系统默认生成的tableView:cellForRowAtIndexPath:方法中的代码,则必须为UITableViewCell注册(填写)重用标识符:identifier.必须要代码方法中的标识符一致.
- swift3使用协议和泛型简化UITableView的使用(续)多种类型的cell注册
- Swift自定义UICollectionViewCell不显示的解决方案
- Swift中tableViewCelll和ImageView中图片背景显示的问题
- IOS的UITableView显示最底部的cell
- swift 实现对UItableView下cell中内容的搜索(1)
- UITableView中cell线条的自定义 表格分割线(swift OC)
- swift 实现对UItableView下cell中内容的搜索(2)
- Swift UITableView使用自定义cell
- iOS:使UITableView一直显示最后一个Cell
- swift UITableView cell自适应高度
- Swift - UIView,UItableView,Cell设置边框方法
- UITableView的最后一行在3.5寸屏上无法显示的问题
- Swift之点击UITableView单元格动态改变cell高度
- UITableView左右滑动cell无法显示“删除”按钮的原因分析