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];

    }

  • 相关阅读:
    [UE4]虚幻引擎的C++环境安装
    [UE4]Drop,扔物品
    [UE4]Grab抓取
    [UE4]抓取准备
    [UE4]用Format Text进行调试
    [UE4]Overlap Event 碰撞事件
    [UE4]Skeletal Mesh的碰撞体
    [UE4]模拟物理
    [UE4]Static Mesh的碰撞体
    [UE4]镜像
  • 原文地址:https://www.cnblogs.com/rollrock/p/4884705.html
Copyright © 2011-2022 走看看