Code Monkey home page Code Monkey logo

awcollectionviewdiallayout's Introduction

AWCollectionViewDialLayout

UICollectionViewLayout for displaying cells in a semi-circle with a nice fish eye effect.

Very handy for quickly browsing items with your left thumb without having some of the content hidden behind your finger while you scroll.

Demo Gif


####Initialize Layout

// Radius : The radius of your circle
// Angular spacing: Angle between items (deg)
// Cell Size: Size of your cell
// Alignment: Supports 2 Types: WHEELALIGNMENTLEFT and WHEELALIGNMENTCENTER
// X-Offset: To translate the circle along the x-axis

AWCollectionViewDialLayout *dialLayout = [[AWCollectionViewDialLayout alloc] initWithRadius:300.0  andAngularSpacing:18.0 andCellSize:CGSizeMake(240, 100) andAlignment:WHEELALIGNMENTCENTER andItemHeight:100  andXOffset:70];

####Enable Snap Mode

[dialLayout setShouldSnap:YES];

####Programmatically scroll to item at index

Use the cell_height variable you used to initialize the CollectionViewLayout and multiply it by the IndexPath.item

// Scroll to item at indexPath (0,2)
 [self.collectionView setContentOffset:CGPointMake(0, cell_height * 2) animated:YES];

Flip Horizontally

You can set the flip option to YES if you want to display your items on the right side of the CollectionView.

[dialLayout setShouldFlip:YES];

awcollectionviewdiallayout's People

Contributors

awdigital 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

awcollectionviewdiallayout's Issues

How to make loop between items.

Hi Currently in your code the scrolling stops once user reach at the either end of the CollectionView but is there any way that we can make a loop between items so that scrolling never stops and item will repeat.

Thank You!!

Magnifier issue

How we can stop the magnifier while scrolling, I mean all the items should be at the same size while scrolling with no effect?

Cells Become Invisible while scrolling

This is really nice component.

Some Cell become invisible while scrolling the scrollview.
Please look at this issue and kindly fix it.

It would be great if you add to functionality to select particular cell and auto scroll it to center position.
Kindly fix this issue, other wise really great component.

AngularSpacing

@awdigital

I was wondering how to interpret AngularSpacing property.

Obviously the angularSpacing is in degrees. Is it in relation to a full circle being 360 degrees or a full circle being 180 degrees.

i.e. Physical angle spacing = 2 * virtual angle spacing, where angularSpacing variable represents virtual spacing

If I have 3 items, and I want them to be evenly divided in the full circle, should angularSpacing be 360/3 or 180/3?

scrollToItemAtIndexPath:

First, I really love this layout; awesome work!

I think I found a bug: I just can't scroll to a specific item programmatically using [self.collectionView scrollToItemAtIndex:[NSIndexPath indexPathForItem:item inSection:0]];

Maybe you can take a look at this behavior.

Could you also show some instructions on how to make the items "snap" to the nearest item, so there's always one item "selected"?

Making CollectionviewDial for infinite scrolling

Hello,

I have around 12 menu items in collection view.I have setup that 12 menu in your collection view but i need user to scroll collectionview infinite means as soon as 12 menus are over it should again start with first menu

Right Dial

I'm trying to find a way to have the same display but with the items coming in from the right of the screen instead of left. Any idea how I might be able to do this?
Here's an image to show you what I'm talking about:

screen shot 2016-05-25 at 15 16 42

Sections

Is there anyway we can add support for multiple sections in this.Waiting for your quick response.

CocoaPod

Nice component, please add it to cocoapods.

Adding new items causes crash

When I try to add items I keep getting this error:

request for number of items in section 0 when there are only 0 sections in the collection view

crashing on line 50 of AWCollectionViewDialLayout.m

This could be due to (a) I load data in from server then reloadData, (b) I have multiple sections.

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.