加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

swift uitableview显示cell最后一列

发布时间:2020-12-14 02:12:17 所属栏目:百科 来源:网络整理
导读:类似qq聊天的效果。每发一条信息,tableview更新cell并且显示最后一个cell func tableView(tableView: UITableView,cellForRowAtIndexPath indexPath: NSIndexPath) - UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("cell") as

类似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
    }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读