moflo / openspringboard

UIKit based Spingboard clone, similar to Three20's TTLauncherView. (Update Aug-9-2011: finally have time to refactor this for iOS5 custom container view controllers)
http://fieldforceapp.com
MIT License
242 stars 38 forks source link

PageControl #9

Open pzmudzinski opened 12 years ago

pzmudzinski commented 12 years ago

On openpsringboard screenshot there's a PageControl used on bottom - is it included in source? Is openspringboard even handling more than one page of icons? How to set more than one page of icons and scroll between them horizontally? Thanks!

moflo commented 12 years ago

Hi, you can modify the openSringBoardLoadIconArray delegate method to specify the page size (the example shows 9 icons per page) and if you supply more than this number of icons in the delegate, the page methods will be employed. Currently, this defaults to horizontal scrolling as with the standard Spring Board.

Please note, iOS6 will support a more robust standard way to handle collections.

pzmudzinski commented 12 years ago

Thank you for answer. However I still need some help. I changed openSpringBoardLoadIconArray method to this:

which gives me this: http://www.imagebanana.com/view/wa7dltl4/iOSSimulatorScreenshot2012062507.24..png

I can't scroll pages, there's no page control and icons overlap of each other. How to do this properly?

I also noticed in OpenSpringBoard.m in buildIconViews code like this: if (page==1) { [self.view addSubview:view]; // [pageOne addSubview:view]; } else { [self.view addSubview:view]; // [pageTwo addSubview:view]; }

I'm confused - is it a right code?

moflo commented 12 years ago

I can't scroll pages, there's no page control and icons overlap of each other. How to do this properly? I'm confused - is it a right code? The general case of an arbitrary number of "pageN" subviews was not yet pushed. The specific case of two subview "pages" (ie., pageOne, pageTwo) is hinted at in the comments.

Perhaps you can contribute a general case of an arbitrary ([itemArray count] % numIcons == pageCount) number of pages to this project?

pzmudzinski commented 12 years ago

So make me sure - OpenSpringBoard is currently working only for one page ?

moflo commented 12 years ago

Just pushed code for a static two-page case, it should be trivial to extend this to the dynamic multipage case.

However, the icon reordering currently does not work across multiple pages!

pzmudzinski commented 12 years ago

Ok, got it... guess we'll need to use UICollectionView eventually but I am looking for something similar for older iOS