Art by waneella_
benemdon / centeredcollectionview Goto Github PK
View Code? Open in Web Editor NEWA lightweight UICollectionViewLayout that 'pages' and centers its cells ๐ก written in Swift
License: MIT License
A lightweight UICollectionViewLayout that 'pages' and centers its cells ๐ก written in Swift
License: MIT License
Art by waneella_
Fixed typo in README.md & CenteredCollectionViewFlowLayout.swift
Found with: https://github.com/ss18/grep-typos
Requesting additional API to enable slide "beyond" the last page.
This gesture is commonly known for intro pages like this https://github.com/ealeksandrov/EAIntroView
So you would swipe. And then keep swiping. And then at some point you understand the instructions or get bored and swipe swipe swipe and it goes away.
Is there anyway to implement a function like didChangeCenteredPage() or something?
I have animations occurring in each of my Collection View Cells but only want the animation to happen when the Cell becomes centered.
Thanks for your help
-Alex
currentCenteredPage
triggers a scrollTo
How to center collection view with load more pull to refresh all data.
Describe the bug
I have used the Collection view in the UITableviewcell. When I reload the cell in uitableview cell. And after reloading the Tableview when i reload the centeredCollectionViewFlowLayout.scrollToPage(index: 0, animated: true)
. It's not working as expected which is cell should be in the center of the screen.
Expected behavior
Should be in the center of the screen.
Screenshots
https://pasteboard.co/JoSCAZC.png
Desktop (please complete the following information):
Smartphone (please complete the following information):
Which version to use for Swift 2.3? I get errors on the latest version, as well as 0.9.3.
Describe the bug
The collection is not vertically centered correctly when the view appears. The collection centers itself once I touch it (slide).
To Reproduce
Steps to reproduce the behavior:
pod try CenteredCollectionView
Expected behavior
Vertically centered collection view
Screenshots
Before Slide:
After slide:
Smartphone
Additional context
This bug only occurs on the beta version of iOS 13. (iPhone Xs Simulator 13.0). Everything is fine with iOS 12.
Describe the bug
when making collectionview using centeredCollectionViewLayout in collectionViewcell.
If collectionView is reloaded, cell is not centered
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Is your feature request related to a problem? Please describe.
Xcode 11 enabled SPM to be used as a dependency manager. Since then, SPM support for libraries would be nice ; especially for One-Class libraries like this one :)
Describe the solution you'd like
Create a Package.swift file ; to enable SPM support
Describe alternatives you've considered
Cocoapods & Carthage are nice, but they feel heavy for small projects
Additional context
If I have spare time in the next few days, I'll submit a tested PR myself ; I could use this nice minimalist lib for a side project I wanna start ;)
This will clean things up significantly, making the project more production safe.
CenteredCollectionView
and make CenteredCollectionViewFlowLayout
main APISo I have been working around with this pod for a day by now. I wanted the UI really bad for my collection view. I tried giving my collection view on my storyboard the CenteredCollectionView class after pod install but nope. That did not work. If you don't mind sharing how to make this work with Storyboard, it will make a world of a difference. Thanks.
pod trunk push CenteredCollectionView.podspec
Right now it appears that CenteredCollectionView doesn't support iOS 13 (ref #53). If anyone in the community of users would like to spare a hand, I would be more than happy to review and merge the code to make CenteredCollectionView support iOS 13.
I'll buy the person that upgrades this some coffee (via a crypto transfer).
I am also looking for a co-maintainer, if anyone is interested ๐
Could you update for swift 4?
Thanks!
It will crash or ' ui layout error ' when i try rotate/ ( demo
hope fix it .
Hello:)
First, thank you for you made this library. It's very helpful for me.
I have a question:
Do you support scroll one by one cell?
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
I am trying to use this code but if we modified or label add in your sample app then its working but same code we use it and we added custome cell and add more than 3-4 lables in up down area its not display. Only center align lable display.
Hello:)
First, thank you for you made this library. It's very helpful for me.
I have a question.
Do you support self-sizing cell?
Checkout facebook/ios-snapshot-test-case
Is your feature request related to a problem? Please describe.
Is there any way we can change item size to smaller which is not centered?
Describe the solution you'd like
The idea is centered item should be bigger than other items.
Hi, nice library you have there. I've been wondering what is the use of that check here? it seems to be checking if the new offset doesn't lie within the natural bounds, and handle that. But isn't this already solved by the default bouncing behavior? I commented out that check, and the demo worked fine.
Hi,
Is there any ways to get the event like "indexAtCenter", or any approaches to observe the "currentCenteredPage" property so that we can know when and which cell has been centered?
I tried KVO on that property using RxSwift but nothing emitted after the initial value (which I set as 0 since there's no optional type in Objective-C).
Hello,
I'm currently running the example code, except with a twist- I added a button that when clicked makes it unclickable in the future. Now, here's the problem: whenever I click on button 1, button 5 is immediately also unclickable. Could this be an issue with my code, or is it directly related to the CenteredCollectionView?
Thank you! This is such a help.
dear,
how can i use this in objective c project. please help.
Hi, I adapted code from the Example project and everything is working perfectly but I'd like to disable the control center.
I've tried setting the isHidden property of the ControlCenterView to true but that broke functionality.
I tried setting the various switches and labels contained in the ControlCenterView but that also broke functionality.
What's the simplest way to remove them from the project while keeping the CenteredCollectionView in horizontal format?
This is what happens when I try to hide the ControlCenterView...
It would nice to have an example to show how to integrate this framework with storyboards. Since storyboards are very popular it would be very beneficial for the future of this project.
I hope to get around to this at some point but am very busy, so if someone in the community could lend a hand it would be greatly appreciated.
collectionView.indexPathForItem(at: currentCenteredPoint)?.row
It's randomly crashing on this line: from crashlytics
log :
Fatal Exception: NSInternalInconsistencyException
UICollectionView received layout attributes for a cell with an index path that does not exist: <NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
If you use a page control controller to show the user the current page the updating is slow.
To update the controller you have to use one of the methods of protocol UIScrollViewDelegate
. But they only track events around gestures, which makes the updating slow when they stop scrolling (the earlier event to update is scrollViewWillBeginDecelerating
, and has a noticeable delay to update)
I think an event for changes over centeredCollectionViewFlowLayout.currentCenteredPage
would solve the problem.
I tried to use observers but is not possible because is a get only property (I suppose is computed).
It's a similar problem to #16, but with "time constraints".
Please tell me if I'm missing something.
Thanks for such awesome project.
Need to find a way to celebrate 1K stars!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.