年年有"余"

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 2704|回复: 0

UITableViewCell的个常用操作

[复制链接]
  • TA的每日心情
    奋斗
    2022-12-13 21:26
  • 签到天数: 371 天

    [LV.9]以坛为家II

    发表于 2014-6-19 08:46:22 | 显示全部楼层 |阅读模式
    1、Cell点击事件代理方法

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {

    }

    2、Cell点击后恢复原状

    在Cell点击事件中调用方法
    [table deselectedRowAtIndexPath:indexPath animated:YES];

    3、选中时系统默认颜色设置

    cell.selectionStyle = UITableViewCellSelectionStyleNone;        // 无色
      
    cell.selectionStyle = UITableViewCellSelectionStyleBlue;          // 蓝色
      
    cell.selectionStyle = UITableViewCellSelectionStyleGray;          // 灰色
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    手机版|小黑屋|Archiver|iOS开发笔记 ( 湘ICP备14010846号 )

    GMT+8, 2024-5-3 11:50 , Processed in 0.050430 second(s), 23 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表