• 九宫格布局


    //
    //  九宫格布局.h
    //  IOS笔记

    -(void)createUI{
        NSArray *titles = @[@"我的设置",@"我的关注",@"我的账户",@"我的收藏",@"我的下载",@"我的评论",@"我的帮助",@"我的应用"];
        
        NSArray *images = @[@"setting",@"favorite",@"user",@"collect",@"download",@"comment",@"help",@"candou"];
        
        
        for (int i=0; i<titles.count; i++) {
            CGFloat buttonW = (KscreenRect.size.width-30*4)/3.0;
            int H=i/3;
            int L=i%3;
            CGFloat butonX = (buttonW +30)*L+30;
            CGFloat butonY = (buttonW +30)*H+64+30;
            
            
            WQDButton *button = [WQDButton  addButtonWithFrame:CGRectMake(butonX, butonY, buttonW, buttonW) title:nil andBlock:^{
                
                if (3==i) {
                    //                CollectionViewController *collection = [[CollectionViewController alloc]init];
                    //                [self.navigationController pushViewController:collection animated:YES];
                }
            }];
            [button  setBackgroundImage:[UIImage imageNamed:[NSString  stringWithFormat:@"account_%@",images[i]]] forState:UIControlStateNormal];
            [self.view addSubview:button];
            
            //        UILabel *label = [UILabel  labelWithFrame:CGRectMake(butonX, butonY+buttonW, buttonW, 30) andtitle:titles[i]];
            //
            //        label.font =[UIFont systemFontOfSize:9];
            //        label.textAlignment=NSTextAlignmentCenter;
            //        [self.view addSubview:label];
            
            
        }
        
    }

  • 相关阅读:
    20201322陈俊池学习笔记6
    关于Transformer中feed forward layer理解
    关于softmax在CV多通道中的理解
    使用SourceTree管理仓库代码
    window10任务栏图标不见了(如何修复)
    c++ 批量修改文件名
    将一个Eigen::Matrix中的数据(数组格式),按行写入到json文件当中.
    git工具:sourcetree使用中的部分问题
    Eigen矩阵除法
    利用3Dslice提取血管中心线
  • 原文地址:https://www.cnblogs.com/er-dai-ma-nong/p/5045687.html
Copyright © 2020-2023  润新知