UITableView自定义Cell
来源:互联网 发布:程序员新人第一天 编辑:程序博客网 时间:2024/05/04 10:51
#pragma mark - TableView-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.array count];}- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CustomCellIdentifier = @"CustomCellIdentifier"; static BOOL nibsRegistered = NO; if (!nibsRegistered) { UINib *nib = [UINib nibWithNibName:@"ListTableViewCell" bundle:nil]; [tableView registerNib:nib forCellReuseIdentifier:CustomCellIdentifier]; nibsRegistered = YES; } ListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CustomCellIdentifier]; cell.selectionStyle = UITableViewCellSelectionStyleNone; [cell.lab setText:[self.array objectAtIndex:indexPath.row]]; return cell;}-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 185;}
@interface ListTableViewCell : UITableViewCell@property(nonatomic,strong)IBOutlet UILabel *lab;@end
//// ListTableViewCell.m// WeiNiXieShi//// Created by vshine on 14-5-18.// Copyright (c) 2014年 wdl. All rights reserved.//#import "ListTableViewCell.h"@implementation ListTableViewCell- (void)awakeFromNib { // Initialization code self.lab.lineBreakMode = NSLineBreakByWordWrapping; self.lab.numberOfLines = 0;}- (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated];}@end
如果要使用下拉刷新或上拉加载可以在Code4App中搜索MJ哥开源的一个封装很好用。
0 0
- UITableView自定义Cell
- ios UITableview自定义cell
- <四>UITableView 自定义cell
- [IOSS]UITableView自定义cell
- UITableView 的 自定义cell
- UITableView的自定义cell
- UITableView 自定义cell
- uitableview自定义cell,cell加载图片
- IOS UITableView 移动自定义cell
- Swift UITableView使用自定义cell
- IOS-UITableView 及自定义cell
- IOS-UITableView 及自定义cell
- iOS UITableView(二)-自定义Cell
- UITableView cell自定义视图中插入UITableView
- UITableView使用自定义cell的例子
- uitableview-cell删除消息\tableViewForHeader自定义
- UITableView-的cell 自定义 高度,样式
- UITableView详解(UITableViewCell(二) 自定义cell)
- 如果说菜谱类应用变现模式不清晰,那么更垂直的烘焙类食谱呢?
- hdu 2896 病毒侵袭
- Struts2 StackContext ValueStack ActionContext
- android程序混淆
- Mina源码阅读笔记(一)-整体解读
- UITableView自定义Cell
- NOJ [1301] Gopher Hole
- WaitForSingleObject
- pca
- 开发TI DSP需要知道的
- 修改android的system.img文件方法
- Mina源码阅读笔记(三)-Mina的连接IoAccpetor
- 对rspec的“才知道”
- 情感金钱