• swift


    1.创建tableview

        private lazy var cellId = "cellId"
        fileprivate lazy var tv : UITableView = {
            let tv = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
            tv.register(UITableViewCell.self, forCellReuseIdentifier: cellId)//注册cell
            tv.translatesAutoresizingMaskIntoConstraints = false// VFL
            tv.showsVerticalScrollIndicator = false//垂直滚动指示器
            tv.showsHorizontalScrollIndicator = false//水平滚动指示器
            tv.delegate = self
            tv.dataSource = self
            tv.bounces = false//弹簧效果
            tv.separatorStyle = .none//分割线
            tv.estimatedRowHeight = 0//预设行高
            tv.estimatedSectionFooterHeight = 0//预设分区头高度
            tv.estimatedSectionHeaderHeight = 0
            tv.backgroundColor = UIColor.white
            if #available(iOS 11.0, *) {
                tv.contentInsetAdjustmentBehavior = UIScrollView.ContentInsetAdjustmentBehavior.never
            }
            return tv
        }()
    

      

    2.UICollectionView

    let JYLoadImageCollectionCellId = "JYLoadImageCollectionCell"
    let JYAddImageCollectionCellId = "JYAddImageCollectionCell"
    private lazy var collectionView: UICollectionView = {
        let layout = UICollectionViewFlowLayout()
        let itemWidth = CGFloat(Int((JY_DEVICE_WIDTH - 10 * 4)/3))
        let itemHeight = itemWidth
        layout.itemSize = CGSize( itemWidth, height: itemHeight)
        layout.minimumLineSpacing = 0
        layout.minimumInteritemSpacing = 0
        layout.sectionInset = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10)
        
        let collectionV = UICollectionView(frame: CGRect.zero, collectionViewLayout: layout)
        collectionV.translatesAutoresizingMaskIntoConstraints = false
        //        collectionV.register(UINib.init(nibName: "JYChooseShopTimeCollectionCell", bundle: nil), forCellWithReuseIdentifier: "JYChooseShopTimeCollectionCell")
        collectionV.register(JYLoadImageCollectionCell.classForCoder(), forCellWithReuseIdentifier: JYLoadImageCollectionCellId)
        collectionV.register(JYAddImageCollectionCell.classForCoder(), forCellWithReuseIdentifier: JYAddImageCollectionCellId)
        collectionV.delegate = self
        collectionV.dataSource = self
        collectionV.backgroundColor = .white
        collectionV.showsHorizontalScrollIndicator = false
        collectionV.showsVerticalScrollIndicator = false
        
        return collectionV
    }()
    

      

  • 相关阅读:
    商业分析07_15辅助产品设计
    商业分析07_14行为序列的分析方法
    商业分析07_13路径挖掘的分析方法
    商业分析07_12精准运营推送
    商业分析07_11归因查找
    商业分析07_10高质量拉新
    商业分析07_08功能/内容上线的评估
    商业分析07_07用户留存分析
    Ubuntu14.04安装CUDA8.0与Cudnn5.1
    Windows编译libcaffe时报cudnn.hpp(114): too few arguments in function call错误
  • 原文地址:https://www.cnblogs.com/qingzZ/p/10102233.html
Copyright © 2020-2023  润新知