facebookarchive / AsyncDisplayKit

Smooth asynchronous user interfaces for iOS apps.

Home Page:http://asyncdisplaykit.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom flow layout did not work in ASCollectionNode ,But work in UICollectionView

yaxunliu opened this issue · comments

Part of the display is not normal In ASCollectionNode:
issue

Normal display should be like this:
normal

Demo

ASCollectionNode :

let layout = EmojiFlowLayout()
        let collecNode = ASCollectionNode(collectionViewLayout: layout)
        collecNode.view.isPagingEnabled = true
        collecNode.dataSource = self
        collecNode.delegate = self

UICollectionView :

 let collection = UICollectionView(frame: CGRect(x: 0, y: 100, width: self.view.bounds.width, height: 150), collectionViewLayout: EmojiFlowLayout())
        collection.dataSource = self
        collection.delegate = self
        collection.isPagingEnabled = true
        collection.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "UICollectionViewCell")
        collection.backgroundColor = UIColor.white
        view.addSubview(collection)