swift下完成tableviewCell的注册创建
2016-08-25 15:42
337 查看
直接上代码
//这里是用xib创建cell的
messageTableView.registerNib(UINib.init(nibName: "MessageCell", bundle: nil), forCellReuseIdentifier: "MessageCell")
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 18
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("MessageCell")
return cell!
}
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 70
}
//这里是用xib创建cell的
messageTableView.registerNib(UINib.init(nibName: "MessageCell", bundle: nil), forCellReuseIdentifier: "MessageCell")
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 18
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("MessageCell")
return cell!
}
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 70
}
相关文章推荐
- 创建自注册的Swift UI 控件
- 立即获得下载任务完成的消息通知。Android DownloadManager通过注册一个广播监听系统的广播事件完成此操作,在创建广播时候,需要指明过滤器为:DownloadManager.ACTIO
- 一步一步SharePoint 2007之二十一:解决实现注册用户后,自动具备访问网站的权限的问题(3)——创建用户
- 完成DELPHI的不可能功能:宏替换!(如何根据字符串来创建对象)
- Visual Studio2005或在asp.net中常碰到的问题:未能创建Mutex,重新把ASP.NET 2.0注册到IIS中,IIS_WPG的权限
- 一步一步SharePoint 2007之二十一:解决实现注册用户后,自动具备访问网站的权限的问题(3)——创建用户
- 解决CD12"未能创建DOM文件,没有注册类别,校验MSXML4安装&
- 利用MS AJAX注册Javascript命名空间并创建类
- 如何用Visual C#来创建、修改注册信息
- 一步一步SharePoint 2007之二十一:解决实现注册用户后,自动具备访问网站的权限的问题(3)——创建用户
- 如何用Visual C#来创建、修改注册信息
- 如何在Delphi中用代码来完成计算字段的创建
- “automation服务器不能创建对象” “库没有注册”
- 一步一步SharePoint 2007之二十一:解决实现注册用户后,自动具备访问网站的权限的问题(3)——创建用户
- 关于解决CommunityServer使用中文名字注册自动创建博客和相册的问题
- WebWork完成用户注册的例子
- IssuVision是怎样完成观察器模式的注册和通知的
- 老鼠Atlas之旅(七):Hands-On Lab 3第三个实验,用Atlas创建个自动完成的textbox
- 注册了好久,终于开博了,欢迎大家多多指教,以后我会多创建原创作品!
- 使用struts2+prototype.js创建无刷新注册检测