What image gallery? [iPhone] - iphone

Hey guys,
checkout this. How can I do something similar? I mean a scrollview with 9x9 images.
Also, how can I put a custom loading image??
Ty.

Allocate and init a UIScrollView, add it to the viewcontroller's view, and then create UIImageViews, set their respective images, and add the image views to the scroll view.
Specifying launch images - get a pic, rename it to Default.png (also might want to get a 2x sized one - call it Default#2x.png) and copy it to the resources folder.

Use some pre-existing code. AQGridView is a solid piece of grid code.

Related

how i can lazy load thumbnail images to scroll view vertically with pages?

i have photo gallery which loaded to scroll view vertically and i only want to load visible pages to avoid memory issues like table views did. Is there a way to do this? i am using core data to get images and there are more than 150+ images in it.
I used this: http://www.markj.net/iphone-asynchronous-table-image/ and I'd think it would help in your scenario as well
if you are using vertical only scroll you may use UITableView with custom UITableViewCell.
This way, you get the lazy load done.

UIScrollView question... loading images

I have a UIScrollView that does not do paging. I am loading about 500 small (64x64-iPhone 192x192-iPad) images. I do not want to load them all into memory. I would like to load them as the user scrolls.
Can anyone tell me where I can set the images to display? I have an object for each image that holds the image resource name, index number and x and y coordinate where it should be displayed in the UIScrollView. I was hoping there was a method I could override where I could create a UIImageView and then add the view to the scroll view on the fly... maybe preloading 6 to 10 images at a time. Every sample I see uses paging and only displays one image at a time.
Any help or example is greatly appreciated.
Thank you
EDIT:
In the ScrollViewSuite examples from Apple there is a Tiling example. That example has a scrollview that popups up displays images to select from. That is exactly what I am trying to do, but Ineed to load them on the fly. The sample loads all of the thumbnail images into memory. Someone somewhere must be doing this because the iPod/iPhone and iPad do not have alot of memory to load all the images.
Apple has some really good demo code that shows how to do this. Check out TiledScrollView.m especially the layoutSubviews method.
write the code in following method of scrollview:
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
I did the same. Load atleast few images in the beginning and then load those images in above method.
PROPERLY ALLOC AND RELEASE IMAGEVIEWS SINCE THEY CAN LEAD TO MEMORY LEAKS
Hope this works for you :)
Cheers :)
Couldn't you just use a UITableView for this?
Edit: Might be worth looking at
u can try making ur tableview horizontal by using CAAffinneTransform and giving the angle as (3.14/2) ie 90 degree annd can have a horizontal tableview with horizontal scroll and can use the above refrence given by MIKE A
regards...

how to add more than 100 uiimageviews in uiscrollview

i have an uiscrollview and i add one by one uiimageviews but when i add more than 40 objects i have problem with memory i guess and the app crashes...what should i do? i am trying to make an app like photo viewer from apple! Help please!
i do not want thumbnais i just want to show the next image when the user flick from one to another but i have to unload the previous image and show the next one
i remove the previous like this
UIImageView l;
l=[[scroll subviews] objectAtIndex:0];
[l removeFromSuperview];
l=nil;
and then i add the next one like this
[scroll insertSubview:imageView atIndex:counter];
but i see a black background no image
please help!
The best way to do this is to load a few of the images at a time into a table view. In each cell of the table, put three thumbnails. You'll need to make a custom cell. That way, the table cells will be de-queued and the memory re-used. Check the Facebook Three20 project, I think they've implemented it like this, so you'll have some code to work with.
http://joehewitt.com/post/the-three20-project/
Ask yourself, do you really need to load all 100 images into memory? Why not just load a few images at a time in the background, depending on what image the user has scrolled to?
Don't do it that way.
If you want to display a 100 small thumbnails, resize them first with core graphics. Then they take up much less memory when you display 100 images at once.
If you want to display a 100 large images but only one is visible at a time, have 1 or 2 image views that load up the current and next images, and animate them in a clever way to make it look an endless stream. You can still use a scrollView, just monitor it's position and position your image views appropriately.
There is exactly an apple sample code that do what you want. Look for the PageControl sample, it is already implemented. Basically the slider gets the image controller from an array of controllers; among other things, when the scroller changes to the previous or next image, controllers are added and removed from this array dynamically to keep memory footprint low.
Have a look at the sample code, it is quite simple.
Hope it helps.

What is the correct way to show/hide a UIScrollView?

I have an iPhone application that uses a UIScrollView to display a larger version of an image on the main screen. I am using IB to create the main screen that has text, small images, and price about a product. I have it setup to show/hide the UIScrollView if the user touches the small images. It works ok, but things are pretty messing in the IB layout. I have to put the UIScrollView over top of everything else and make it hidden by default. What I'd like to know is if there is a better way to accomplish this. Can I create a new nib and load the scroll view in it and load that nib when the users touches the small image? Should I construct the scroll view in my code and not use IB? Any input is appreciated!
Sorry if this is a newb question. I'm still learning.
Set scrollView.hidden = YES and then when tapped, set it to NO.

How to add image in UIActivityIndicatorView

i want to add image into initWithActivityIndicatorStyle instead of using the others like
UIActivityIndicatorViewStyleWhiteLarge. So, when come to loading page, the image will act as
image loading.
Any help, i am truly appreciate it . ^^
Thanks
You can't do that. UIActivityIndicatorView draws the system activity indicators. If you want to display a custom image then you shouldn't be using a UIActivityIndicatorView. Either create a custom view, or if you just want to display an image use a UIImageView. UIImageView also supports animating several images in a loop if you want to do that.