3 Star 0 Fork 0

Gitee 极速下载 / CCHexagonFlowLayout

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/cyrilchandelier/CCHexagonFlowLayout
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

CCHexagonFlowLayout

UICollectionView layout for both horizontal and vertical management of hexagonal cells

ScreenShot

Screenshots

ScreenShot - ScreenShot

Installation

There are two ways to use the library in your project:

  1. Manually add the library files to your project
  • CCHexagonFlowLayout.h
  • CCHexagonFlowLayout.m
  1. Using CocoaPods
pod 'CCHexagonFlowLayout'

Usage

Begin with the creation of an instance of the CCHexagonFlowLayout

// Build layout
CCHexagonFlowLayout *layout = [[CCHexagonFlowLayout alloc] init];
layout.delegate = self;

Choose an orientation

layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
// OR
layout.scrollDirection = UICollectionViewScrollDirectionVertical;

Configure these variables according to your own hexagonal cells:

// Should be negative in order to reduce the space between hexagon and obtain the hive effect
layout.minimumInteritemSpacing = -30.0f;

// You must find the correct value to obtain the desired effect
layout.minimumLineSpacing = 10.0f;

// Your cell size as a square
layout.itemSize = CGSizeMake(230, 200);

// The gap is a positive float that will be use to obtain the hive effect
layout.gap = 76.0f;

Default flow layout options can be used for header/footer supplementary views and sections

layout.headerReferenceSize = CGSizeMake(320, 50);
layout.footerReferenceSize = CGSizeMake(320, 50);
layout.sectionInset = UIEdgeInsetsMake(20.0f, 20.0f, 20.0f, 20.0f);

Tests

  • Works fine with iOS7 on iPhone 3.5" and 4" and iPad
  • Not tested on iOS6

Contribute

The component has been developed for a single project, feel free to contribute to improve it.

The MIT License (MIT) Copyright (c) 2014 Cyril Chandelier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

CCHexagonFlowLayout 是一个 UICollectionView 布局扩展,可支持六边形的水平和垂直的排版要求 展开 收起
Objective-C
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Objective-C
1
https://gitee.com/mirrors/CCHexagonFlowLayout.git
git@gitee.com:mirrors/CCHexagonFlowLayout.git
mirrors
CCHexagonFlowLayout
CCHexagonFlowLayout
master

搜索帮助