keighl/KTCenterFlowLayout
Acerca de
Alinea las celdas de la vista de colección con el centro de la pantalla.
Otros proyectosCrecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalKTCenterFlowLayout
KTCenterFlowLayout is a subclass of UICollectionViewFlowLayout which Aligns cells to the center of a collection view. It effectively enforces the minimumInteritemSpacing.
Usage
# In your Podfile
pod 'KTCenterFlowLayout'
Objective-C:
KTCenterFlowLayout *layout = [KTCenterFlowLayout new];
layout.minimumInteritemSpacing = 10.f;
layout.minimumLineSpacing = 10.f;
[[UICollectionViewController alloc] initWithCollectionViewLayout:layout];
Swift:
let layout = KTCenterFlowLayout()
layout.minimumInteritemSpacing = 10.0
layout.minimumLineSpacing = 10.0
UICollectionViewController(collectionViewLayout: layout)
Example
See the layout in use in the ./Example app:

Horizontal Scrolling
This layout doesn't work with UICollectionViewScrollDirection.horizontal.
Self-sizing cells
This layout doesn't work with self-sizing collection view cells (estimatedItemSize). Of course, neither does the vanilla UICollectionViewFlowLayout. Pull requests appreciated from anybody interested in solving self-sizing layouts!
Explorar proyectos relacionados
Cargando…