iCarousel same images issue - iphone

In my carousel view after 7 images next image shows the first image , the other one shows the second image although they are different images. I mean after 7 images they start repeat images. I am sure it is coming different images. My images are buttons. When i click them they show detail view. In detail view they show correct images but in carousel not. Do you have any idea what causes that. Thank you.

It sounds like you are using the reusingView feature wrongly.
You can fix it by increasing numberOfVisibleItems, but that's not actually the right way to do it since it uses up more memory and slows down the carousel.
Paste your carousel:viewForItemAtIndex:reusingView: method into the question and I'll check it for you.

Related

How to make full screen zoom feature with scrolling multiple images with TNImageSliderViewController?

I am losing most of my work time stucking at scrollview,autolayout issues.And now,when i found TNImageSliderViewController.I see that i have hope in scrolling images with no autolayout issue.Thanks to the developer who write TNImageSliderViewController.But,after that I want to do another thing which still keep making me stuck.I tried many tutorial and video and which keep making me stuck.
Here is what i need to do...
1.When I clicked one of my image in scrollview,i want to see full screen of that images i click at another view.
2.That another view should also have capabilities like TNImageSliderViewController which we can slide images.
3.I want to add zoom with pinch or tapped zoom at full screen image that i clicked.
Any Idea?or suggestion or library which it can do it easily and completely with no autolayout issue which we can rotate as we like?
Please help...Please,I really need help.Also all newbie like us might want the same answer like me.

How to load images with high Res in UIscrollView

Can anybody tell me how to load or set images with high resolutions in UIScrollVIew .
I am getting memory warning and app is getting crashed without any stack trace.
Thank you in advanced.
I was also working on an app which had UIScrollView and had to request for High Resolution Images. The thing is, you should first check the size of the images being downloaded. Lets say, if the image size is more than 10MB, then it would be difficult for your app to survive with such a heavy load.
You can consider the following methodologies.
1.Download your images and compress them.
2.At a particular instance of time, there is no need to populate your Scroll Views array with all the images at once, instead try to have only three images,i.e
1.The current one which is being shown.
2.The previous one.
3.and the image next to the current one.
You can also take help from the link
http://www.raywenderlich.com/10518/how-to-use-uiscrollview-to-scroll-and-zoom-content
You should use the concept of lazy loading. As you said you used UIScrollView that's mean you have lot's of images and I guess you show them one by one or two or three at a time. Load only that images which are visible to the user. One more thing you have to maintain that is when user swipe to next image or next branch of images that's mean next image(s) that's are going to visible to the user. At that time before load the new images release all the previously loaded images from memory. I hope it'll solve your problem.
If you are trying to create multiple UIImageView of high resolution image inside UIScrollView, then it will create memory warning and application will crash.
I will suggest you to try reusable UIImageView , like create 3 UIImageView and replace images in it.
Try circular scrollview.link or UICollectionView

Swiping through a stack of images?

I recently came across this app, tinder, which has a really cool functionality.
You start off with X images. User can swipe left or right to go through each image to signal whether the user likes or dislikes something.
An image can be seen here:
I have been looking at UICollectionView to do this, but I am a little confused about the custom layout I should be using.
I have been thinking of generating a bunch of cells and then setting different z-index and stacking them on top of one another with the same frame.x.
Any tutorial/advise/help available?
This is simple UIImageviews. and tinder only showing two top images and set a background frame just like facebook image gallery.
When you swipe top image current thread fire next image and it replace current image with new image. And you can add like, comment views as you want.
This sounded like fun, so I built an open-source library that mimics the interface you described.
https://github.com/modocache/MDCSwipeToChoose
The sample app included in the project is nearly identical to the UI in your screenshot.

Using One UIImageView that Changes Based on Button Pushed

This is a very basic question, but I cannot figure this out. I'm new to iOS/XCode. I've gone through a few tutorials that somewhat covered this (but a little more complex). I have an Android app that I'm trying to port over to iOS. I'm using storyboards for this app.
The basic premise is that the app contains 27 thumbnail/full images. For this question, we'll say the 27 pictures are split into 4 categories: cats, dogs, sharks, whales. Currently, I have the app launching with Navigation Controller w/ View that shows 4 Buttons with these categories. These push out to 4 separate view controllers each set up with buttons with the thumbnail as the image. I want to select the thumbnail and show a scene with the full image. I only want one full image view controller with a UIImageView in it that will display the full image of the thumbnail pressed. (Using table views may be easier, but I want to control the user interface and have more than just a rows of items to select.) Also, I'm not sure if this matters in the eventual set up, but from the full image scene I will want to add a play button that will play a local mp4 file (but that's for another day).
The image set will remain static so I was trying to incorporate NSArray with the full image name stored. I believe I have to add a file that is subclass of ViewController and incorporate code that will take on the full image file name based on the button pushed. This is where I'm stuck. In java for Android, I just had listeners on each button and used a case statement to set the full image variable and passed it to my full image class/xml.
Another option I think I remember seeing somewhere is I could use the title of each button and enter the full image name there. Then when the button is pressed, the title is passed to the full image view. I think this eliminates the need for an array (???).
Any help is appreciated.
Thanks,
Jason

How to preload or lazyload images in a UITableView on iPhone?

I'm having a problem when scrolling down and up a tableView on iPhone it gets kind of stuck while loading the images i need a method to preload the images so the scroll can be fluid or load the images 'till the scroll event stops...
any help on this?
I found this article very helpful. It provides a very detailed example for lazy loading of images in the main runloop.
Lazy Table Images Sample Code included in iPhone Developer Resources. Check out Photo Locations Sample Code as well. It uses Core Data and "lazy loading" techniques if your image files are stored on the device.
Well, generally speaking, preloading images for table view is a bad idea. Think of a following situation: you have 100 cells, each containing one image. That means you'll have to load 100 images before showing the table, which will have a serious impact on avaliable memory.
The "loading effect" you're talking about can be caused by two things:
a) as you have said, the problem with loading images. If so, do it in another thread, and pass the image to main thread when it loads
b) You're using images that are bigger or smaller than the given size. This will result in resizing the image when it appears on screen, causing the ugly stop-effect - the solution is to draw images in size which is exactly the same as their size.
Chope this was helpful, Paul
Not sure about images, but with text I have downloaded JSON files when the view loads, parsed into an array and then loaded the tableview with that array.