zoukankan      html  css  js  c++  java
  • 不可深究啊,

    -(void)resetRoomBtn

    {

        [[_mctView viewWithTag:2000]removeFromSuperview];

        CGFloat kWidth = (screenW-20)/4;

        NSInteger arrayCount = _roomImgArray.count;

        for (int i = 0; i<arrayCount; i++) {

            ImageInfo *info = [_roomImgArray objectAtIndex:i];

     

            NSInteger column = arrayCount%4;//

            NSInteger row = arrayCount/4;//

            UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];

            btn.frame = CGRectMake(column*kWidth,row*kWidth, kWidth, kWidth);

            [btn.imageView setContentMode:UIViewContentModeScaleAspectFill];

            btn.tag = 2000;

            if (info.isLast) {

                [btn setImage:info.mImage forState:UIControlStateNormal];

                [btn addTarget:self action:@selector(pressPicBtn:) forControlEvents:UIControlEventTouchUpInside];

            }else{

                [btn addTarget:self action:@selector(showDeletePicAction:) forControlEvents:UIControlEventTouchUpInside];

            }

            if (info.mImage) {

                [btn setImage:info.mImage forState:UIControlStateNormal];

            }else{

                [btn sd_setImageWithURL:[NSURL URLWithString:info.imageUrl] forState:UIControlStateNormal];

            }

            [_mctView addSubview:btn];

            _mctView.frame = CGRectMake(0, _mctView.frame.origin.y, screenW, row*kWidth);

            TTLog(@"%@%@",btn,_mctView);

            

        }

        

     

        

        

        _middleView.frame = CGRectMake(0, _mctView.frame.size.height+_mctView.frame.origin.y, screenW, _middleView.frame.size.height);

        _licenceView.frame = CGRectMake(0, _middleView.frame.size.height+_middleView.frame.origin.y, screenW, _licenceView.frame.size.height);

        

    }

     

     

    -(void)resetLicenceBtn

    {

        [[_licenceView viewWithTag:1000]removeFromSuperview];

        CGFloat kWidth = (screenW-20)/4;

        NSInteger column = _licenceImgArray.count%4;//

        NSInteger row = _licenceImgArray.count/4+1;//

        int index = 0;

        for (int i = 0; i<row; i++) {

            for (int j=0; j<column; j++) {

                ImageInfo *info = [_licenceImgArray objectAtIndex:index];

                UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];

                btn.frame = CGRectMake(j*kWidth, i*kWidth, kWidth, kWidth);

                [btn.imageView setContentMode:UIViewContentModeScaleAspectFill];

                btn.tag = 1000;

     

                if (info.isLast) {

                    [btn addTarget:self action:@selector(pressPicBtn:) forControlEvents:UIControlEventTouchUpInside];

                }else{

                    [btn addTarget:self action:@selector(showDeletePicAction:) forControlEvents:UIControlEventTouchUpInside];

                }

                

                if (info.mImage) {

                    [btn setImage:info.mImage forState:UIControlStateNormal];

                }else{

                    [btn sd_setImageWithURL:[NSURL URLWithString:info.imageUrl] forState:UIControlStateNormal];

                }

                [_licenceView addSubview:btn];

                _licenceView.frame = CGRectMake(0, _licenceView.frame.origin.y, screenW, row*kWidth);

                TTLog(@"%@%@",btn,_licenceView);

                index++;

            }

        }

        

    }

     

  • 相关阅读:
    常用搜索指令
    chrome浏览器常用快捷键
    倒排文档
    hdu4570Multi-bit Trie (间隙DP)
    HTTP工作原理
    腾讯和58都市“聘请”秘诀是什么?
    Atitit。团队建设--管理最佳实践--如何留住关键人才,防止人才外流 ??
    于Eclipse传导C/C++配置方法开发(20140721新)
    通过京东淘宝的技术发展和技术演进,探索未来的技术和体系结构
    C++ Primer 学习笔记_41_STL实践与分析(15)--先来看看算法【下一个】
  • 原文地址:https://www.cnblogs.com/guligei/p/4573863.html
Copyright © 2011-2022 走看看