Can someone give me one source file working ?
Alternatively you can look at my AQGridView, which can display anything in a grid, using an API similar to that of UITableView.
You might want to take a look at Facebook's Three20, specifically their TTPhotoViewController class.
Update: Other options (possibly more modular and easier to integrate in your project):
https://github.com/mwaterfall/MWPhotoBrowser
https://github.com/kirbyt/KTPhotoBrowser
http://github.com/alanQuatermain/AQGridView (as suggested by Jim)
Related
If I would like to have lazy loading like google+ or facebook app (maybe even 9gag), should I go with UITableView or UIScrollView?
The goal is to load whole new set of cells or scrollview pages (not just thumbnail like apple lazyloading tableview). If you have facebook app, try scrolling down fast and you will see what I mean.
Any example would be also helpful.
Thanks.
You should prefer table view for this. with tableview , You can use reusable customcell. tableview can be useful for Auto layout in landscape mode and if app is universal the tableview is more useful.
You can try this: https://github.com/nicklockwood/AsyncImageView. This is a best example for loading images asynchronously. The library can also be used to load and cache images independently of a UIImageView as it provides direct access to the underlying loading and caching classes.
Using Grand Central Dispatch you can do this.
The following link might be useful.
http://www.raywenderlich.com/4295/multithreading-and-grand-central-dispatch-on-ios-for-beginners-tutorial
Take a look at SDWebImage, really easy to use, it support caching and asynchronous loading.
I would use a uicollection view. Here is an example that uses uitableview, but you can take it and modify it a bit to work with a collection view.
http://developer.apple.com/library/ios/#samplecode/LazyTableImages/Introduction/Intro.html
If you would like to use a third party library, I would suggest looking at AFNetworking It's one of the most highly used and has a very easy to use function that extends UIImageView LINK
Also as an FYI, a scrollview is part of a tableview.
Which open source alternatives to UIScrollView is there?
I need paging so it would be awesome if we could categorize by that feature.
I'm looking for alternatives for the sole reason that Apple recommends against putting UIWebView inside UIScrollView. More specifically I experience problems with fixedcontent on iOS 5. But let's stick to the question: alternatives to UIScrollView.
Check TTScrollView, part of the famous Three20 framework.
https://github.com/facebook/three20/blob/master/src/Three20UI/Headers/TTScrollView.h
[Edited 2013-09-16]
CHScrollView is another open source alternative of UIScrollView. It is written by myself :)
If you want to make something like photo gallery, but web views instead photos, you can use UIPageViewController which shows webviews.
Check out DDPageControl
https://github.com/ddeville/DDPageControl
For more controls just search on http://cocoacontrols.com
I have seen a few grids made with UITableView but I don't really like how close together each cell is to the other. If there is a way of creating a grid system like the home screen on an iphone (the screen after it is unlocked) if would be great. I don't need an exact solution but a point in the right direction, maybe a set of libraries to look through would be great. I am running xcode 4.4.1
Thanks!
The key is UIScrollView has a paging mode (since could have more buttons than fit in the view). It's covered here's in Apple ocs:
http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/UIScrollView_pg/ScrollViewPagingMode/ScrollViewPagingMode.html
If you use that, each 'page' would have n buttons/views that when clicked would call a protocol/delegate call back for the consumer with the data to handle and it would evenly layout the UIView/buttons across that page view. Contact me if you want my sample.
You probably don't want to require iOS6 as a minimum requirement but if you do, you can do as H2CO3 suggested in the comment and us UICollectionview. Here's a tutorial: http://www.raywenderlich.com/22324/beginning-uicollectionview-in-ios-6-part-12
There's also some open source launchers that you can look into their code. Here's some (I'm sure there's more).
http://www.cocoacontrols.com/platforms/ios/controls/sespringboard
Code is at: https://github.com/sarperdag/SESpringBoard
Also: http://www.cocoacontrols.com/platforms/ios/controls/openspringboard
Use UICollectionView. You can create grid type views using that. It is available in iOS 6.
If you can target iOS 6+, use UICollectionView. It's one of the best new things in iOS for years and it will be as important as UITableView.
The layout you're asking for is only a few lines of code.
NSHipster has a good explanation of UICollectionViews and Ray Wenderlich has a good tutorial.
(There's lots of example code out there, but here's a very simple example project I did recently for another question involving UICollectionViews)
I want to create an application excacly like appStore.
A nice table (I have the source code from apple using custom table cell)
But my main problem is that I cannot find a nice tutorial or a guide on how to make the product detail page.
I want to have a label at the top then a text and after that I want to have the images.
I notice that in appStore when you reach the images it locks there for a while!
How can I do that???
I tried using a UIScrollView but I believe this is not the case.
I am thinking using tableView again with custom cells but again I am not sure.
Any ideas? or any good working example? or tutorial?
thanks for your time :)
start from here:
http://blog.webscale.co.in/?p=284
Which will teach you basic table design skills and how to create custom cells with images on the left.
Then if you would like to learn how to create a tab bar application an be able to have a navigation controller at the top then you can follow this descriptive tutorial step by step to achieve this.
http://www.devx.com/wireless/Article/44897
What do you get after following these two tutorials?
the appStore application, well not exactly but you will get your own version.
EDIT: Added Details page how to achieve appStore like UIScrollView effect.
follow this brilliant video tutorial.
http://blog.sallarp.com/iphone-ipad-appstore-like-uiscrollview-with-paging-and-preview/
Have fun
PK
Then
Is there any web-resource (gallery perhaps) showing all user interface elements made from UIView(or other?), so it will give me some quick idea what controls exist, what do they look like?
It's not a web resource per se (depending on what you mean), but you can get the source code for the UICatalog sample from Apple and see what is offered. It's also a good project to look at in case you want to go beyond the look and and actually see how it's implemented.
I'm not sure if this is what you're looking for, but here's a PSD file containing all the iPhone UI elements.
if you use Omnigraffle, there is an iPhone stencil. http://graffletopia.com/stencils/392