Animating a custom background image on a UINavigationBar - iphone

Since iOS5 there seems to be plenty of ways to add a custom background image to a navigation bar. I've tried using the appearance proxy, which works very well to change the appearance of all UINavigationBars application wide, and the setBackgroundImage:forBarMetrics: method for changing an individual navigation bar.
Is it possible to animate a change to the background image dynamically?
My application has two main states, and I wanted to fade the navigation bar between two colours to represent these two states. I haven't yet found a way to do this.
Thanks.

Related

How to make tableview's content displayed under a transparent navigation bar?

How to make tableview's content displayed under a transparent navigation bar?
Like this:In "Photos" app, albums displayed under navigation bar.
Special thanks
If you use _rootNavigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent; then set correct tableview frame thats it. If you are in xib dont forget to simulate the translucent navigation bar.
One way I have found to accomplish this is by shifting your tableview's superview up to have the origin at {0, 0}. However after researching more several people have said altering the superview (UIViewControllerWrapperView) is a bad idea. However I also have not found any information on why just changing the frame would create problems. I am shifting the superview right now and haven't found any problems related to it yet.
Might be you can set it like this:
[navigationBar setAlpha:0.5f];
For making the navigation bar transparent alone, you can check this post, How to make a Navigation bar transparent and fade out like in the photo app in the iPhone
Also check this How to set the transparency color for Toolbar and Navigation bar using MonoTouch?
I am not sure whether you can add the table view behind the navigation bar. You might have to add it as a subview of self.parentViewController.view.
Another way to do this is by hiding navigation bar and using a transparent tool bar in place of that. This can be added on top of the current view. The only problem is with the back button. You might have to use custom button for that.

iPad style navbar on iPhone app

Hey, on iPad the navigation bar is normally silver and on the iPhone it's normally blue. Is there any easy way to make the silver navbar on iPhone app?
Thanks!!
If you just want to change the color of your navigation bar, the easiest way to do this would be to add your navigation bar in IB, then click on the navigation bar's attributes panel. Change the tint color to whatever color you would like in there and it will show up accordingly on your app. Similarly, if you are adding the navigation bar programmatically, you should be able to set the tint color yourself with something along the lines of myNavBar.tintColor = [UIColor someColor];. I hope this helps.
As of iOS 5 this can be easily achieved without any manual tinkering. Read this up.

iPhone HUD style progress bar

I've been wanting to create a HUD style loading bar like the SMS app on the iPhone used to have but I don't know how to. I was wondering if anyone has done this before or if there is a tutorial somewhere for it? I just think it looks so nice and would like to use it rather than the built in loading progress bar.
It should be very simple to implement using Core Animation layers (the CALayer class).
The bar would be a layer with rounded corners and the fill could be drawn by a custom drawing method.

Build a nice progress bar

I need some inspiration on how to build a nice progress bar for the iPhone.
What I want to build is a custom progress bar, as I've drawn here:
alt text http://img.skitch.com/20100317-tf185nscpf41u1xp3s6fqbhux6.png
My approach up to now is to use a PNG (gray in the figure above) with a transparent rounded rectangle. Through this rectangle, users see the moving bar. It would be nice to draw this bar with Quartz and give it a fancy animation (similar to the Mac OS X progress bars).
Any hints how to do this
you could use a couple nested UIViews and control the size of the childview and have different colors of backgrounds to show the progress or you could subclass the UIProgress bar like this example of the slide to unlock UISlider that has animation. The example is of a UISlider but the method used for animation could also be used on a progress bar without the difficulty of handling touches.
here is a link directly to the code from that discussion

Using translucent UINavigationBars

I am using InterfaceBuilder to set up my app. I have several views being controlled by a UINavigationController. In IB I set up the views using the simulated metrics to position the elements below the Navigation Bar.
I have a background texture that is placed in the window object of the Main.nib so that it is shared throughout the app. I want that texture to be visible behind a transucent navigation bar.
If the actual navigationBar's style is BlackOpaque the elements of the various views are positioned correctly below the navBar when the app is run.
If I set the NavigationBar to be translucent, view elements are repositioned to the bottom of the status bar when the app is run so that they are visible behind the navigationBar, even though they are positioned correctly in their various nib files.
How do I defeat this behavior?
I figured out the answer...
If you do NOT want objects to be slid up to be positioned behind a translucent NavigationBar, In IB, set the simulated metrics for the navBar to none, and position the view elements as desired.