animated sprite images in navigation bar buttons - objective-c

Working on an iOS app right now - was curious to if it is possible to use an animated sprite for a button in the Top Nav Bar. For example, having the hands on a clock button continually turn via a looped animation (like a web GIF - but better). Is this possible, and if so, how difficult is it?
Thanks!
Zach

Check out the animatedImageNamed:duration: and animatedImageWithImages:duration: methods of UIImage. You will have to put each frame of each sprite in a separate file, or (if you don't want to split up your animated GIF) use the ImageIO framework to create separate UIImage objects for each frame in the GIF.

Related

Facebook App Style UIImageView

I have bunch of images inside a UIScrollView and have a tap event setup on each image. When I try to make the image full screen it actually is cut off by the scroll view. I am trying to implement a Facebook style UIImageView where the image zoom in and takes over the full screen on tap.
Does anyone have suggestion on how to approach this cause the way I am doing the image is cropped to the size of the scroll view.
Well, usually you would disable clipping, but the scrollview relies on clipping to do its job so that won't work.
My suggestion would be to push a copy of the image above the scrollview, and animate that to full screen. You should be able to get the rect using convertRect:toView: and it would be pretty straightforward from there.
btw, Is there a reason not to use a tableView for this?
When tapped hide the image and add the image at the proper place in the scrollview superview and over the scrollview. Then animate it to take the full screen.
Facebook App style UIImageView is nicely implemented in below given source code, you can take a clue from this
https://github.com/michaelhenry/MHFacebookImageViewer

How to handle image manipulation in IPad

I want to be able to place images in an iPad app from a given directory and then let the user resize the image and move it around on the screen.
My question is: what's the best view to use that would allow user to resize the image (with gesture recognition) and move it around on the screen?
Thanks in advance
Quartz 2D
http://developer.apple.com/library/ios/#documentation/graphicsimaging/conceptual/drawingwithquartz2d/dq_overview/dq_overview.html#//apple_ref/doc/uid/TP30001066-CH202-TPXREF101
Can draw anything you want.
Control with gestures
You're looking for UIScrollView with the viewForZoomingInScrollView: delegate method implemented.
Since you want to display an image, add a UIImageView to the scrollview and return it in the delegate.

How to recreate Jetsetter's iOS teaser photo & photo viewer slideshow transition?

One of the more impressive iOS app that I've come across is Jetsetter's due to its great design, incredible interface, and creative uses of animation. One of my favorite components of the app is the teaser photo interface they have for the hotels/venues. They provide a minimized photo slideshow, but if you want the full view you can click it and it expands to expose a larger version of the image. You can see a blurry video of this in action here.
I'm interested in recreating something similar. I'm well aware of the paged galleries like MHPagingScrollview (which is how the larger photo viewer functions), yet what I'm trying to figure out is the proper way to handle the transition. I've also seen libraries that handle the Ken Burns effect for images. However what is not clear is whether or not there are separate view controllers.
Is this a transition between two separate view controllers? Or would the minimized and maximized photo viewer be part of the same controller? How would you most efficiently replicate something similar? I've embedded a screen shot below to illustrate the before and after. The video linked above however most effectively illustrates this transition.
Mobile engineer from Jetsetter here. They are two separate controllers, but the transition animation occurs in the first. Here's the flow:
A user taps the smaller photo.
A transition view containing the full size image is placed directly on top of the smaller image.
The transition view animates to the bounds of the screen.
The photo viewer controller is presented as a modal without animation, completing the effect in one seamless animation.
The effect is reversed when the modal controller is dismissed.
The trick lies in your transition view. We created a UIView subclass (with clipsToBounds enabled) that contains an imageView. The bounds of the transition view expands to reveal the imageView, resulting in no distortion of the final image during the animation.

How to move this ColorPicker from iPhone to a portion of iPad scene?

I found a ColorPicker (ILColorPicker) that takes the whole screen on an iPhone. I want to use it in my iPad app (XCode4 using StoryBoards)... it's asking me to "In your view controller's XIB, add a UIView and then set it's class to ILColorPickerView ". I don't want to use the entire scene, just a small part of it... is there another way I can accomplish this? (using Layers, frames, etc)?
You could programmatically create a popover (UIPopoverViewController), and put the color picker as the view for your popover.

Laggy UIScrollView

At the moment I'm working on an iPad explore game which has a hexagon tile map.
I've created a UIScrollView that contains a background view (the game map) and buttons in the form of hexagons (for interaction). I add every UIButton to the view via addSubview.
But... when I add more than 100 buttons the view gets laggy (no surprise here). But what should I do to solve this?
Example:
scroll view http://img233.imageshack.us/img233/5527/screenshot2011090110353.png
Adding UIButtons isn't the way to go here. You should probably draw the "buttons" in a custom -drawRect: method and use -touchesEnded:withEvent: to decide what the user wanted to do.