zoukankan      html  css  js  c++  java
  • IOS TableView 去除点击后产生的灰色背景

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
        static NSString *CellIdentifier = @"activityTableViewCell";
        activityTableViewCell *cell = (activityTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
             cell = [[activityTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        }
        
        cell.selectionStyle=UITableViewCellSelectionStyleNone;//设置cell点击效果
        
        return cell;
    }
    

      或者

    //重写 cell 点击事件
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
    {
        //当离开某行时,让某行的选中状态消失
        [tableView deselectRowAtIndexPath:indexPath animated:YES];
    }
    

      

  • 相关阅读:
    test
    封装和构造方法
    面向对象
    数组的排序
    UDP编程(八)
    多的是面向对象你不知道的事
    面向对象组合的使用
    类成员的进一步阐述
    面向对象初始
    吾日三省吾身
  • 原文地址:https://www.cnblogs.com/ansyxpf/p/6133481.html
Copyright © 2011-2022 走看看