UIButton - UIImage bounce - uibutton

Do you know how to make this buttons bounce?
http://www.youtube.com/watch?v=Ku1lB9etiN8

They used some of the UIView animateWithDuration methods. My guess is that that started the buttons behind the large green button, animated them to spin, then animated their position. This is a custom thing they built, and you'll have to build it from scratch as well.

Related

Detect how far the keyboard has animated?

I would like it to appear the keyboard is pushing another view up. The problem is there is a UITabbar between the UIView I would like to animate in unison with the keyboard, problem being the UITabbar breaks up what would give that appearance. What I would really like to be able to do is detect when the keyboard is at the exact point my view then animate that view.
Is this possible without going into the private API's?
Too be clear I have the animation working, just working out a way to make it smoother. The effect I am trying to create is similar to the messages app, but there is a UITabbar between to UIView and the bottom of the screen.
Perhaps this will work...
The height of the keyboard on the iPhone is 216 pixels. The default animation duration for the keyboard display is 0.25 seconds.
The height for a tab bar is 44 pixels.
So, if you started the UIView transition animation afterDelay:((44.0/216.0) * 0.25), this should look right on an iPhone. Perhaps try and see?
If this works, it's pretty easy how to figure out for landscape, and iPad, etc.
Additionally, if this does work, in your final implementation, I would avoid hardcoding the 0.25.

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

Mimicking iOS 6 camera rotation

I have been doing some experiments with a custom camera using AVFoundation and so far everything's been great. The AVCam example got me very far and I am quite happy with the results.
However, one thing I still don't get is how the iOS default Camera app handles rotations. It seems like the background does not rotate at all but all the overlay controls do.
This is probably not a camera-specific question but how could I achieve this behaviour?
TLDR: Have a background camera layer, controls on top, how to rotate controls without rotating the background layer?
I've been wondering on the same...
My guess would be that the native Camera viewController doesn't rotate using the UIViewController rotation mechanism
no status bar rotation
no 'basic' rotation of subviews - toolbar doesn't move, buttons are animated
and of course the view containing the camera preview doesn't rotate :)
Rather it must call [UIDevice beginGeneratingDeviceOrientationNotifications] and handle specific UI update (grey buttons fading position switching, and toolbar buttons image rotation)
[[NSNotificationCenter defaultCenter] addObserver:self selector:#selector(yourUpdateMethodForRotation:) notificationName: UIDeviceOrientationDidChangeNotification];

animated sprite images in navigation bar buttons

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.

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.