您的位置:首页 > 移动开发 > Swift

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
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息