V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Dean
V2EX  ›  iOS

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

  •  
  •   Dean · Sep 12, 2018 · 3530 views
    This topic created in 2788 days ago, the information mentioned may be changed or developed.

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

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

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


    需要做一层转换。实现
    -----------------
    1 | 2 | 3 | 4 |
    5 | | | |
    Dean
        2
    Dean  
    OP
       Sep 13, 2018
    @0924wyr 多谢,明白了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2564 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 785ms · UTC 06:53 · PVG 14:53 · LAX 23:53 · JFK 02:53
    ♥ Do have faith in what you're doing.