zoukankan      html  css  js  c++  java
  • tableviewcell透明

    对于group的tableview  要向设置其cell背景色完全透明有点困难,通常的设置都无法彻底去掉背景色,以下方法可以解决问题,并可以为每个cell都加上边框(当然,想完全透明就别加setBorderWidth)

                [cell setBackgroundColor:[UIColor clearColor]];

                UIView *tmp=[[UIView alloc] init];

                [cell setBackgroundView:tmp];

                [[tmp layer] setBorderWidth :1];

                [[tmp layer]setBorderColor:[[UIColor grayColor] CGColor]];

                [tmp release];

    自定义TableViewCell注意事项:didDeselectRowAtIndexPath不响应

    1. 如果你的cell是自定义的,如果在自定义的类里边加入了诸如:

     -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;

    -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;的方法,那么后边,你可能就悲催了,你会发现,不过你怎么该,

    -(void)tableView:(UITableView *)_tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath

    和-(void)tableView:(UITableView *)_tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath两个代理方法基本不会被调用(为什么说“基本”,因为笔者的table是点击4到6次就会触发一次)。

    2.UITableView selectRowAtIndexPath 不回调 didSelectRowAtIndexPath 解决方案

    Apple’s documentation says that didSelectRowAtIndexPath:index will not be invoked whenselectRowAtIndexPath:indexPath is called. To call didSelectRowAtIndexPath use the following:

      [[tableView delegate] tableView:yourtableView didSelectRowAtIndexPath:index];

    This basically invokes the delegate.

    3.如果没写代理

  • 相关阅读:
    php navigat备份
    IBM技术俱乐部主席竞选
    IBM技术俱乐部主席竞选
    IBM技术俱乐部主席竞选
    IBM技术俱乐部主席竞选
    分治策略实验报告补充示例 汉诺塔实现
    分治策略实验报告补充示例 汉诺塔实现
    分治策略实验报告补充示例 汉诺塔实现
    分治策略实验报告补充示例 汉诺塔实现
    数字三角形问题 NOJ 1226
  • 原文地址:https://www.cnblogs.com/ChrisYu/p/4886128.html
Copyright © 2011-2022 走看看