V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Dean
V2EX  ›  iOS

使用 UICollectionView 做一个类九宫格布局遇到疑惑的问题

  •  
  •   Dean · 2018-09-12 20:08:18 +08:00 · 2443 次点击
    这是一个创建于 2014 天前的主题,其中的信息可能已经有所发展或是发生改变。

    顶部 UICollectionView 作为 TableViewHeader section = 1 item =4 显示正常 item=8 也正常 但是 item >4 两行布局错乱 如下图所示 item=4 item=8 item=5

    调试和计算好久 itemsize 一直没有发现问题,有遇到类似同学指点下

    2 条回复    2018-09-13 14:04:25 +08:00
    0924wyr
        1
    0924wyr  
       2018-09-13 00:16:56 +08:00
    系统接口对应到视图的映射如下:
    -----------------
    1 | 3 | 5 | |
    2 | 4 | | |


    需要做一层转换。实现
    -----------------
    1 | 2 | 3 | 4 |
    5 | | | |
    Dean
        2
    Dean  
    OP
       2018-09-13 14:04:25 +08:00
    @0924wyr 多谢,明白了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4899 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 04:00 · PVG 12:00 · LAX 21:00 · JFK 00:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.