美文网首页
tableView,Cell ,Row,Section,主线程,

tableView,Cell ,Row,Section,主线程,

作者: 天城一哥 | 来源:发表于2016-08-02 19:39 被阅读83次

关键词:tableView header footer section Cell /Row
枚举类型

行高默认
行数
每一行数据

Cell、Header、Footer宽度一定与TableView相同
x/y/width无效(TableView中)

同一个Cell对象会重复使用,在队列中获取空闲的Cell
var cell = tableView.dequeueReusableCellWithIdentifier("cell")
4.几个关键函数:
numberOfSectionsInTableView
numberOfRowsInSection
cellForRowAtIndexPath
didSelectRowAtIndexPath
viewForHeaderInSection
heightForHeaderInSection

5.建立一个类比建立数组或者字典要优越的多,可以在敲代码的时候弹出类中的成员变量
比如: var channel_id: String!
var channel_name: String!

  1. 在refreshTableView放入主线程中执行
    方法一:
    self.tableView.performSelectorOnMainThread(#selector(self.tableView.self.reloadData), withObject: nil, waitUntilDone: false)
    方法二:
    self.performSelectorOnMainThread(#selector(self.refreshTableView), withObject: nil, waitUntilDone: true)

7.tableView.reloadData() //重新加载

相关文章

网友评论

      本文标题:tableView,Cell ,Row,Section,主线程,

      本文链接:https://www.haomeiwen.com/subject/skxqsttx.html