创建一个可重用的UITableViewCell代码
2015-08-28 19:58
411 查看
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //1.创建cell static NSString *ID = @"cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; if (cell == nil) { cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID]; } //2.设置cell的数据 cell.textLabel.text = @"哈哈"; return cell; }
相关文章推荐
- iOS:选择器控件UIPickerView的详解和演示
- value="hello boy"
- 【codechef】Chef and the Number Sequence(构成最长公共子序列为L的可能性)
- Android UI设计:自定义Dialog
- UI初级连载九----------UITableView的使用
- iOS 笔记五:手势识别 UIGestureRecognizer
- flume+kafka+Druid 流数据查询聚合工具
- UI初级连载八------------标签控制器
- ueditor配置
- easyui-treegrid篇
- UITableView
- UIControl
- POJ 题目3581 Sequence(后缀数组+离散化)
- NGUI
- UIDatePicker
- UIImagePicker照片选择器
- 中断底半部&顶半部tasklet 与 workqueue
- UIImageView
- Leetcode 225 Implement Stack using Queues 使用队列实现栈
- UIKit结构图