Mini Scrollbar with thumbnails on iphone - iphone

I was wondering, what would be the best way, to implement an 'extra' scrollbar, showing thumbnail versions of the pages, you are currently viewing.
In my case, I would like to have maybe around 20 images, which I would animate with Cover Flow Layers and while I 'scroll' up an down to view them, a scrollbar appears at the side, showing the smaller thumbnail versions of all the pages while the thumbnail currently visible is rendered slightly highlighted.
Is there anything specific I need to keep in mind? Thanks in advance for any ideas!

You are not giving much info to work with:)
Build a UIScrollView and a UIView, stick all the thumbnails into the UIView, stick the UIView into the UIScrollView.
If you have a lot of images, consider loading them in as "dummies/blank image" and have an NSOperation load them in the background. Consider releasing images that are outside of the screen, so that if 3-7 is on the screen then you only load in 2-8 and release everything else.
Regarding the logistics of it:
Build a viewController for holding everything. Then build a thumbnail viewController "component" that has a delegate method for setting the "displayed" image and maybe one for scroll and click.
Build a FullSize viewController component for handling the full size images. Have that also implement some delegate methods to communicate to the top most viewController. Add the two components to the top viewController, hook up the logic and you are done.
Make sure there exists only one model array/dictionary in the top most viewController and "feed" that downwards to the thumbnail and fullsize viewController, when some one clicks or scrolls, inform the top most viewController and have that update the other viewController.
Was that the kind of answers you were looking for?
:)

Related

Whats the approach to create a view similar to the one at apple app store

I wanted to know how can we design the view controller such that.., the upper half of the screen remains fixed and the below part of the screen can be navigated through.. !!
Should we use slipScreenController here ?
Your description sounds nothing like the Appstore app but the Appstore app simply has one vertical UIScrollView and another horizontal UIScrollView inside that for images.
If you are referring to browsing categories in AppStore then:
That is a tableView implemented in such way that it doesn't take the whole screen area. You need to create a UIViewController (not UITableViewController) and than add a tableView to the view (using Interface Builder or code). That way you can change the size and position of the tableView and use the remaining area of the view for something else, for example a UISegmentedControl above the tableView.
If you are reffering to reading description and images of single app then I think that UIScrollView is used for displaying images, not sure about the rest.

Special UIScrollView with multiple objects (3) on each page

What I want to accomplish is something like this:
Two different scrollViews, and each one scrolls horizontically. Each showing 3 images, and a half one (or 1/3th) piece of the next image in the datasource of the scrollview.
Does anyone know how to accomplish such a scrollview?
I also want to be able to tap an image to flip it and show some information and a button to the detail. (See lower scrollview).
Tapping it again would just show back the image, much like the coverflow ui inside itunes, but without the coverflow being 3D...
Any help is welcome :)
Thanks in advance,
Lewion
Scroll view doesn't have a datasource. What you are looking for is standard scrolling and nothing special.. So it is definitely doable... Check the scrolling and photo scroller sample codes from apple developer samples. For more implementations of scroll view check the scroll view suite sample code and read the scroll view programming guide.
The flip animation is also a standard animation for a view and is easily doable. For example, create a utility application for iphone. It has a flip side view. See how that animation is done.

Lazy loading of subViews into a non-paging UIScrollView

I am trying to implement a filmstrip-like UIScrollView that will be populated with thumbnails of catalog pages. Selecting a thumbnail image will cause the main UIScrollView to move to the selected page. The Catalog may contain 100 - 200 pages, and I want to load them lazily only when required.
I have done this in a UIScrollView with paging enabled, but haven't seen anything on the best way to do this in a non-paging scenario. There will be 6 thumbnails visible in the UIScrollView (+ 1 when the view is being scrolled) at any one time. I want to dequeue and reuse the thumbnail's UIView when the view is scrolled, as I am doing in the main UIScrollView (which is a paging scroll view).
Thanks -
Jk
I am also going to suggest you take a look at some sample code of Apple, that is, Photo Scroller. If you are a registered iOS developer, you should also take a look at the WWDC10 session about scroll views in iPhone applications.
http://developer.apple.com/library/ios/#samplecode/PhotoScroller/Listings/main_m.html
What you need to do is mimic the behavior of a table view (which is nothing more than a subclass of UIScrollView). What you should mimic is the reuse of the cells. It is pretty easy to implement and will dramatically reduce the memory foot print of your application since you only load the content that is currently visible in the scroll view.
I hope this helps.
Check out the scrollview suite sample code from apple. The tiled example can probably be repurposed very easily.
http://developer.apple.com/library/ios/#samplecode/ScrollViewSuite/
Check out this class..it may proove helpful..
VSScroller

Strategy to lazy load images for buttons within UIScrollView?

I have a horizontal UIScrollView that contains UIButtons (though it could be any object). I would like to only download images for these buttons as the user scrolls and they are seen. I would also like an activityindicator running on each button while the images are downloading. Here's what I've tried with results:
Check content offset of uiscrollview and download images for visible buttons. Problem: issues getting activity view shown within subclassed UIButton and not desired usability since images are only downloaded once scrolling stops.
Add subviews (not buttons) to the UIScrollview hoping to use the view's ViewController to initiate a downloaded on viewDidAppear. Problem: viewDidAppear never seems to get called (because I am using addSubView?).
I've seen other apps that do this kind of loading but need some guidance on the typical set-up. Ebay's app is a great example. All items have a default image until the item comes into view, then an activityindicator runs and the items unique image is downloaded.
Thanks for assistance.
Without actually trying it out, here's my idea:
You can use the UIScrollViewDelegate method scrollViewDidScroll: to find out when your scroll view finished scrolling and then use [UIScrollView contentOffset] to determine which part of the scroll view is visible and (CGRect)convertRect:(CGRect)rect fromView:(UIView *)view to determine the button's position within the visible part of the scroll view. Have a method that checks if the button has had its image loaded yet and if not, load it and refresh the view if necessary.
Most such apps are using a UITableView, not a plain scroll view. Joe Hewitt's Three20 framework has a TTImageView class that can do lazy image loading and is pretty well suited to this kind of use.

UIButton Game character selection to UIImageView animation

I am almost at the end of coding my kids educational application, woohoo!.
But... Im stuck on something.
When app loads i have my main view. It has 4 buttons for flipviews(each with ten views of content) and 4 buttons for character selection(an image that will follow you through every screen of content).
Problem is im unsure on how to link UIButton selection to UIImage display in multiple views. I want the user to choose a character button and then continue to the flipviews and in the views the image displayed should be the one that they have selected on the main view. So everytime they return to the main view they can change the character that will follow them around the app.
Any thoughts, help or code would be much appreciated!
Thank You
Alex
Make a new object, a subclass of UIImageView, which has a -setImage method. Once you set the image, then where ever you embed that object, it will display the same image. You could even have that subclass view have a score displayed next to it, or a name or other stats, so as you go from one screen to another, you have all that info follow you around with the image. No need to create labels in all the screens for global info like that.
In summary:
make a new subclass of UIView or UIImageView in Xcode using the New File... menu. You would do new UIView if you will have other items than just an image.
add methods that allow you to set the image, update text stats etc.
BONUS: you can make the class handle taps, so if a user taps the image, you could do something like provide help or run a cute little animation
embed that object in any screens you wish. Keep in mind that you can have that view be sized differently in each screen using transforms. Cool, no?
that's pretty much it!
Good luck!