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)
tv.translatesAutoresizingMaskIntoConstraints = false
tv.separatorStyle = .none
tv.backgroundColor = UIColor.white
tv.delegate = self
tv.dataSource = self
tv.bounces = false
return tv
}() // MARK: - UITableViewDelegate, UITableViewDataSource
extension JYJYRtbMineVc:UITableViewDelegate, UITableViewDataSource{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
} func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: cellId, for: indexPath) return cell
}
}

  

2.流水布局

    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(width: 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
}() extension JYShopDetailFigureVc:UICollectionViewDataSource, UICollectionViewDelegate,UICollectionViewDelegateFlowLayout{
func numberOfSections(in collectionView: UICollectionView) -> Int {
return 1
} func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 1
} func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: JYAddImageCollectionCellId, for: indexPath) as! JYAddImageCollectionCell
return cell
} func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
}
}

  

最新文章

  1. JavaScript 基础回顾——数组
  2. php和syslog
  3. Docker Hub仓库注册,使用
  4. C# 对话框隐藏 标题栏
  5. NYOJ 106背包问题
  6. bash把所有屏幕输出重定向到文件并保持屏幕输出的方法
  7. hdu2571动态规划
  8. Winform动态加载TabControl用法
  9. git使用图解
  10. Redis系统学习 二、数据结构
  11. 【面向对象设计原则】之里氏替换原则(LSP)
  12. webpack的四个核心概念介绍
  13. 统计字符串中字符出现的次数(||和&&的区别)
  14. 不同组的id列表的汇总对比
  15. PAT 乙级 1091 N-自守数 (15 分)
  16. k-vim安装及The ycmd server SHUT DOWN (restart with ':YcmRestartServer')这种错误的解决方法
  17. Jquery 组 表单验证
  18. 尚硅谷springboot学习8-yaml基本语法
  19. Python框架级编程的能力要求
  20. 原!上线遇到的问题, java序列化关键字transient 修饰的属性变成null了

热门文章

  1. mybatisGenerator自动生成pojo、dao、xml文件
  2. shell命令中用source 和sh(或者bash)执行脚本的区别,以及export的作用
  3. debian下redis2.8.17安装过程
  4. 8张思维导图学习javascript
  5. OpenWrt上搭建纯L2TP服务器[ZT]
  6. ArcGIS案例学习笔记2_1_山顶点提取最大值提取
  7. .net上的 jpa
  8. fwrite()中参数含义——size和count经常用搞反
  9. 3DMAX 批量 场景 对象 导出 .X格式 脚本
  10. platform 系统是windows还是liunx