UITableViewCell的重用代码
2015-11-25 00:35
423 查看
</pre><pre name="code" class="objc"><pre name="code" class="objc">- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //创建cell static NSString *cellID = @"cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID]; } //设置cell的数据 cell.textLabel.text = @"文字"; return cell; }
相关文章推荐
- SPOJ 1557. Can you answer these queries II 线段树
- UI编码指南
- Hibernate4之Query接口HQL方式查询
- Hibernate4之SQLQuery接口SQL方式查询
- UIImage图片 转 NSData
- android新建程序时出现Errors occurred during the build
- android:supportsRtl="true"
- IOS UIDatePicker
- Message,MessageQueue,Looper,Handler ——由view.post(runnable想到的)
- The server encountered an internal error that prevented it from fulfilling this request.
- UIAutomation学习入门
- 在android studio中新建android gradle project的时候connect refused:connect或者卡在building project...或Refreshing
- UITableView、UITableViewCell、Xib
- IOS UIDatePicker
- Elasticsearch [2.0] ☞ Java Client API ☞ Query DSL
- 爬爬爬之路:UI(十一) UITableView(三) 自定义Cell 多Cell混合 自适应高度 及cell的状态控制
- 我的iOS学习历程 - UITableView的高级使用
- HDU 1047 Integer Inquiry
- UI基础-UITableView 高级
- 随意细解:UI -- 自定义TableViewCell