如何在自定义cell里面判断第一个cell

来源:互联网 发布:百分之衫淘宝网站 编辑:程序博客网 时间:2024/05/15 05:54

首先可以在cell的.h文件中声明一个变量index
@property (nonatomic, assign)NSInteger index;

在控制器里面:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{    MyTableViewCell *cell = ........;    if (indexPath.section == 0 && indexPath.row == 0) {        cell.index = 1;    }}

在cell的.m文件中根据 cell.index = 1;来进行相应的操作就可以了。

0 0
原创粉丝点击