I am using the first collection view and I'm not sure how to do something ..
< P> I have a UICollectionView containing 12 cells. I set the collective view horizontally to scroll and the cells are standing next to each other. I was also turning paging so that I could use the UIPAZ control to activate the scrolling.I show the collection view only four cells on the screen at any time. When the scene loads, I get four chambers, no problem. However, when I scroll horizontally, I get 4 and half cells. Never just four
Is there a way to tell the four cells to show in the collection only once?
As a mark, you can easily control the size of your archive view.
If changing the shape is not practical, you can set the content inset on the archive view.
CGFloat cellwidth = ... // cell width CGFloat archive ViewWidth = ... // archive view width CGFloat desired selection ViewWidth = cellWidth * 4.0; CGFloat horizontal embedded = archive visual-instrumental - desired collationviews; // Collection View UIEdgeInsets inset = UIEdgeInsetsMake (0, horizontal inset / 2, 0, horizontal inset / 2) in the center of; Self.collectionView.contentInset = inset; // or, to leave the archive view UIEdgeInsets inset = UIEdgeInsetsMake (0, 0, 0, horizontal embedded); Self.collectionView.contentInset = inset;
Comments
Post a Comment