Swift UITableView基础
来源:互联网 发布:amf数据分析器 v22 编辑:程序博客网 时间:2024/06/05 07:13
class DDBaseViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { var _dataSoure = NSMutableArray() override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = UIColor.red for index in 0...10 { let title = String(index) _dataSoure.add(title) } let frame = CGRect(x: 0, y: 64, width: self.view.bounds.size.width, height: self.view.bounds.size.height) let tableView = UITableView(frame: frame, style: .plain) tableView.delegate = self; tableView.dataSource = self; self.view.addSubview(tableView) } func numberOfSections(in tableView: UITableView) -> Int { return 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return _dataSoure.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let identifier = "identifierCell" var cell = tableView.dequeueReusableCell(withIdentifier: identifier) if cell == nil { cell = UITableViewCell(style: .default, reuseIdentifier: identifier) } cell?.textLabel?.text = String(describing: _dataSoure[indexPath.row]) return cell! } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() }}
阅读全文
0 0
- Swift UITableView基础
- swift基础UI之 UITableView
- Swift基础(十六)UITableView
- swift uitableview
- swift UItableView
- UITableView --Swift
- swift表格(UITableView)介绍与基础实现
- Swift UI控件 --> UITableView
- swift入门- UITableview注意事项
- swift UITableView使用
- swift - UITableView 使用
- swift UITableView 表视图
- swift UITableView使用
- Swift-UITableView的实现
- Swift 爬行篇 UITableView
- Swift之UITableView
- 基于swift的UItableview
- 基于swift的UItableview
- C# 6.0新特性
- java导出Excel...............
- 详解 GNU C 标准中的 typeof 关键字
- 实用10大原则:网页UI设计全适用!
- 安装you-get和ffmpeg for Mac
- Swift UITableView基础
- Gulp基础入门学习
- java NIO系列教程(十二)
- Nginx日志中字段解析——正则表达式
- Eclipse 关闭 XML 文件验证的方法
- python学习笔记(数据类型)
- 详解Glide图片加载库常用方法
- 移动web 键盘挡住输入框
- day04