zoukankan      html  css  js  c++  java
  • cell单选

    先上图给看看效果

    cell单选逻辑就是取出上一个选中的cell 设置图片为默认图片 在取出点击的cell 设置图片为选中图片即可

    废话不多说直接上代码

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

    {

        

       // [tableView deselectRowAtIndexPath:indexPath animated:YES];

        

        NSIndexPath * indexold = [NSIndexPath indexPathForRow:self.oldIndex inSection:self.oldSectionIndex];

        

        HBAutoReplyCell * cell = [tableView cellForRowAtIndexPath:indexold];

        cell.checkImageView.image = [UIImage imageNamed:@"CQweixuanzhong.png"];

        

        HBAutoReplyCell * cell2 = [tableView cellForRowAtIndexPath:indexPath];

        cell2.checkImageView.image = [UIImage imageNamed:@"CQxuanzhong.png"];

        

        self.oldSectionIndex = indexPath.section;

        self.oldIndex = indexPath.row;

        

    }

  • 相关阅读:
    session概述
    Flask实现登录功能【附完整Demo】(转)
    Python __repr__()方法:显示属性(转)
    Python使用SQLAlchemy连接数据库CRUD
    网络基础知识集合
    面向切面编程AOP
    SQL基础 insert table_name_1 (field1,field2,...) select value1,value2,... from table_name_2 ...
    java中char类型的变量为什么可以赋值为整型数字?
    iOS应用生命周期
    视图生命周期与视图控制器生命周期
  • 原文地址:https://www.cnblogs.com/supersr/p/6112296.html
Copyright © 2011-2022 走看看