Displaying a UIImageview in a UICollectionview - ios

I'm making an app where I have a UICollectionView and I want some collectionviewcells to display an image. What should I do in my code for the UIImageViews to show up? Aside from that, what should I do for my collectionviewcells to show up as well? I looked to a lot of places on the internet and nothing has worked. Any suggestions are appreciated.

I recommend to use PSTCollectionView for showing the collectionview in your view. Download the code and play with it. Read readme.txt for additional information.
GitHub Link
Hope this will help you a lot.

Related

Scrolling UICollectionViewCell to background instead of vertical

I'm trying to recreate the Shazam Discover UI by subclassing UICollectionView/UICollectionViewFlowLayout.
I've got as far as paging the cells and making them the right size, however, I'm having trouble getting the cells to scroll to the background, as in, I don't have a clue on how to get it done, I've searched everywhere but can't seem to find it.
An example of what I'm trying to achieve:
Any help/tips on how I could do this would be greatly appreciated.
edit: I ended up building my own solution:
https://github.com/JoniVR/VerticalCardSwiper
You could use third party libraries to achieve the same.
You may use StickyCollectionView. This is an Objective C based library. I believe this one with some customization will help you to approve this.

What do I do when I have very long views with lots of images in iOS app

I'm an iOS newbie and for an app a view will have around 20 photos with a audio player under each so you can listen to someone speak about the images.
How do I go about with this? Would I just make a very long view controller with all the images and audio? It would be a lot of images in total as there are around 5 views with these images and audio.
Or is there a way to have this content elsewhere and get the app to pull the content into the view?
I hope I make sense. Any tutorials/ideas would be a lot of help!
I strongly suggest you use a UITableView or UICollectionView (which are very similar code-wise, but have a different display style).
This will be a good way to manage UX and memory because the cells are just made for that kind of things.
You can find good tutorials about this on raywenderlich or appcoda
For example this one
After this is implemented you'll wanna have a look at customs cells probably, so you can display/move/interact with them in a more... well, customized way.
That you can also find very easily on appcoda &/| raywenderlich
For example, here.
How about you use UICollectionView or UITableView. All your Images/Audio components are similar to each other. So you can use advantage of paging.
It will cost you much less memory since you'll only be consuming the memory for the images( in this case cells) that are showing.
Read a tutorial about UITableView or UICollectionView.

UICollectionViewLayout issue with the cell resziing

I have checked the solution all over stackoverflow and came across a couple of those to rectify the issue I am facing.
Below are the screen shots of the problem that i am facing while using collectionview in iOS7.
The application is toggling between these two views on every build process. Sometimes it displays the correct implementation and sometime is displays the incorrect one.
Gone through a lot of posts where extension of the custom layout with UICollectionViewFlowLayout was an option along with shouldInvalidateLayoutForBoundsChange and layoutAttributesForElementsInRect. But still the problem persists.
Does someone ran into similar kinda issue? Will be great if you guys can put some enlightment to this one.
I would suggest you try using something like DCIntrospect or simple logging to see what the frames are for your collection view cells and the collection as a whole.

iOS Image Gallery scrolling horizontally

Hi I want to create an image gallery where you can slide left and right to see them. I was wondering what is the best way to do this or if there are any existant libraries I can use. I have attached an image of what I want to do.
UICollectionView is the answer for your question ,you can easily manage as many images as you want in the UICollectionView, please refer to the following link :
http://skeuo.com/uicollectionview-custom-layout-tutorial
Hope it will help you.
use iCarousel. They have a demo version of it. check it first before using it
If you are developing for native iOS a page control object is exactly what you are looking for

PageControl with multiple xib's?

I'm having trouble with getting Page Control set up with multiple xib's. I searched on Stack on the internet for a while now but all I've been getting is getting Page Control set up with an Array with colors or images. Is it possible to get a UIScrollView with PageControl for multiple View Controllers? I'm thinking that I should use (initwithNibName: method), but I'm not sure on how to set it up with the scrollview. Any help would be greatly appreciated, thanks.
Yes, it is possible. Check this very useful library out. It's an iPhone UIScrollView with horizontal paging like mobile Safari tabs HGPageScrollView.
It works pretty great in our app.
GitHub HGPageScrollView.
[UPDATE]
Here's another example. Check this link.

Resources