zoukankan      html  css  js  c++  java
  • tableview适配

    //#define IOS7_OR_LATER   ( [[[UIDevice currentDevice] systemVersion] compare:@"7.0"] != NSOrderedAscending )
    
    - (void)setFrame:(CGRect)frame {
        if (IOS7_OR_LATER) {
            NSInteger inset = 10;
            frame.origin.x += inset;
            frame.size.width -= 2 * inset;
        }
       [super setFrame:frame];
    }
    

      

    #pragma mark----------iOS7 适配----------
    - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
    {
        // only one cell in section - must be rounded on top & bottom
        if (indexPath.row == 0 && indexPath.row == [tableView numberOfRowsInSection:indexPath.section]-1)
        {
            UIImageView   *testView2=[[UIImageView  alloc]init];
            testView2.image=[UIImage  imageNamed:@"白框1.png"];
            cell.backgroundView = testView2;
        }
        // 第一个 first cell - must be rounded on top
        else if (indexPath.row == 0)
        {
            //        cell.top    = YES;
            //        cell.bottom = NO;
            UIImageView   *testView2=[[UIImageView  alloc]init];
            testView2.image=[UIImage  imageNamed:@"白框上.png"];
            cell.backgroundView = testView2;
        }
        //最后一个  last cell - must be rounded on bottom
        else if (indexPath.row == [tableView numberOfRowsInSection:indexPath.section]-1)
        {
            //        cell.top    = NO;
            //        cell.bottom = YES;
            UIImageView   *testView2=[[UIImageView  alloc]init];
            testView2.image=[UIImage  imageNamed:@"白框下.png"];
            cell.backgroundView = testView2;
        }
        else
        {
            //        cell.top    = NO;
            //        cell.top    = NO;
            UIImageView   *testView2=[[UIImageView  alloc]init];
            testView2.image=[UIImage  imageNamed:@"k2.png"];
            cell.backgroundView = testView2;
        }
    }
    

      

  • 相关阅读:
    基于 Docker 的 MySQL 主从复制搭建
    获取 Docker 容器的 IP 地址
    Maven 学习资料
    docker 中,修改了 mysql 配置,如何重启 mysql?
    TiDB 学习资料
    Sharding-JDBC 学习资料
    Druid(数据库连接池) 学习资料
    JWT 学习资料
    Maven 拥有三套相互独立的生命周期:clean、default、site
    Maven 生命周期的阶段与插件的目标之间的绑定关系
  • 原文地址:https://www.cnblogs.com/hl666/p/3800035.html
Copyright © 2011-2022 走看看