zoukankan      html  css  js  c++  java
  • UITableView 点击展开的实现

    推介看下这里的 内容  http://www.cnblogs.com/kenshincui/p/3931948.html

    IOS8 above

    UITabliViewCell 利用 autolayout 实现的,这里就不多说了

    主要代码

    1.

        self.tableView.rowHeight = UITableViewAutomaticDimension;

        self.tableView.estimatedRowHeight = 70;

    2.

    -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

    {

        NSLog(@"heightForRowAtIndexPath=:%ld",indexPath.row);

        if( indexPath.row == selectIndex )

        {

            if( !isOpened )

                return 130;

            

            return UITableViewAutomaticDimension;

        }

        else

        {

            return 130;

        } 

    }

     

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

    {

        selectIndex = indexPath.row;

        isOpened = !isOpened;

        [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];

    }

  • 相关阅读:
    hp_jetdirect 9100漏洞检测
    fenghuangscannerV3 EXE版本
    计划:6.10
    [PY]进制转换
    OpenStack 制作镜像
    Kernel 问题小记
    Ubuntu 问题小记
    Git 常用命令
    OpenStack 构建单测环境
    SDN 杂谈
  • 原文地址:https://www.cnblogs.com/rollrock/p/4884705.html
Copyright © 2011-2022 走看看