Giter VIP home page Giter VIP logo

lxmwaterfalllayout's Introduction

LXMWaterfallLayout

A collectionViewLayout layout cells like waterfall, which add the missing collectionViewHeader and collectionViewFooter.

LXMWaterfallLayout is inspired by CHTCollectionViewWaterfallLayout, and made several improvements to make it easier to use. It is subclass of UICollectionViewLayout and it's usage is just like UICollectionViewFlowLayout.

screenshot

传送门传送门是我写的总结

Requirements

Swift3.0 +
Xcode8.0 +

Install

1, CocoaPods
add pod 'LXMWaterfallLayout' to your podfile and run pod install
2, Manual
drag LXMWaterfallLayout.swift into your project

Updates

1.0.6

  • add LXMHorizontalMenuLayout;

1.0.4

  • update to Swift4.2,Swift4.1 and before please use 1.0.3

1.0.3

  • Fix a bug

1.0.0

  • Add horiziontalAlignment and verticalAlignment property, which make LXMWaterfallLayout supports alignment now;
  • Add support for UICollectionViewScrollDirection.horizontal

0.0.4

  • Fix bugs with contentInset

0.0.3

  • Add LXMLayoutHeaderFooterProtocol and LXMHeaderFooterFlowLayout
    Now both LXMHeaderFooterFlowLayout and LXMWaterfallLayout confirm to LXMLayoutHeaderFooterProtocol so the architecture is more clear, what's more, if you have your own collectionViewLayout and you want it to have a header or footer too, you can complete it in minutes by adopting LXMLayoutHeaderFooterProtocol

How to use

It is just like UICollectionViewFlowLayout, all you have to do is LXMWaterfallLayout() and assign it to a collectionView

Issues

if (find any bug || have any problem) {
   feel free to open an issue or pull request
} else {
   star it if it helps
}

I will try my best to help as soon as I see it~

License

LXMWaterfallLayout is available under the MIT license. See the LICENSE file for more info.

lxmwaterfalllayout's People

Contributors

phelthas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lxmwaterfalllayout's Issues

can't refresh collectionViewFooterView location

set UICollectionView layout

let layout = LXMHeaderFooterFlowLayout()
layout.collectionViewFooterHeight = 100

when reset numberOfSections and numberOfItemsInSection, then

collectionView.reloadData()  

the collectionView's footerView does't change the location

自定义竖列高度

以下是我尝试了的方式:

我在 func columnWidth(atSection section: Int) -> CGFloat { 方法中,改写了 column height
举例:我想要两个竖列,第一个竖列占据整个屏幕的 60%, 第二个占据40%,其中去掉间距3
改写后的确成功实现了但是有一个比较麻烦的问题。

因为是根据图片的尺寸/比例 & 竖列宽度来计算高度,才可以实现动态高度。所以一排两张都有了照片后,下一张照片是在下一排的左边还是右边是不固定的,请看图

image

我理解他这个排序的依据是什么,但是没有找到办法能很好的实现 两个竖列固定 60% 40%, 图片根据竖列宽度计算高度排列的方式。

不知道你有没有什么建议?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.