Change UINavigationItem Color to Black - iphone

I am looking at example provided by Apple called LocateMe. I am basing my application on similar UI flow. In that example the top bar of the screen is black. Looking in the code and xib file I am not able to figure out how did they get that black bar on the top. When I set up my project exactly like them, I get blue bar. Please help.

That particular project did it by setting UIStatusBarStyle to UIStatusBarStyleOpaqueBlack in their Info.plist (which is why you couldn't find it). You can also achieve this in code this way:
[[NSApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque];
EDIT: I re-read your question, and it's not clear whether you're asking about the navigation controller bar or the status bar (which is the bar at the very top of the screen). The above is for the status bar. The Navigation Controller bar was set to black by going to the GetLocationSetupView.xib and selecting the Navigation Bar and selecting the "Black Opaque" style.

Related

Make ButtonBarPagerTabStripViewController NavigationBar transparent

I am using the XLPagerStrip pod in my current app and I would like to extend the tableviewcontroller inside my ButtonBarPagerTabStripViewController under the nav bar and have users able to see it through the text that is on button bar navigation bar. To do this usually I would make my navigation by transparent like from the examples here, however it doesn't seem to work with the ButtonBar. I am wondering if there was an easy way to do this or if this is unsupported by the library currently? Thanks!
I ended up using the link I posted above and on creation of the bar controller setting its navigation bar. This made it transparent.

iPhone: background seems to be clipped out from under translucent status bar in SOME tabs only

This is a continuation from original problem. Part of the original problem was solved and with new understanding I wanted to be able to restate the problem that still exists, acknowledge the problem that was solved, and provide more information on it and give a better title, due to new understanding.
My app is tab bar based, and has a UITabBarController that is created through the main nib (MainWindow.xib). Each tab references a UINavigationController, again created through the main nib (MainWindow.xib), and each UINavigationController has a root view controller created in the nib as well. Each of these UIViewControllers is a custom VC that has its own nib, class definition, etc.
The application is set (in the app plist) to have a translucent status bar. This works. The status bar is translucent. The first 4 tabs all have a custom background image (currently 2 images composited on the fly with the second being an overlay with < 1 alpha -- will eventually be replaced with a single composited image once development is done) in their individual VC and the last uses a standard background color chosen in its individual nib.
The translucent status bar should overlay the background image, as each image is currently set full size and upper left origin (320w x 480h -- will eventually be replaced with one that cuts out the tab bar at the bottom for efficiency and origin 0,0). However, this only happens in the first tab, and in the tab that uses a nib set background color/pattern.
Beyond the initial setting of the rootViewController in the app delegate did finish launch method,
[[self window] setRootViewController:[self tabBarController]];
there is no layout code in any of the VC. It is all defined in the nibs. (Yes I am old school)
Here are the two that work:
On the first image you can see that the "white" outline of the background image continues up along the sides and across the top of the status bar. On the second one you can see the background stripes continue up into the status bar.
Here is one of the three tabs that this does not work right on:
You can see that it does not have the white going up into the status bar and across the top. Instead of translucent black on blue it is just black.
Here are the shots from IB to show that they are all set up exactly the same
The root tab bar controller:
First Tab Navigation Controller and viewcontroller (which works correctly):
Second Tab Navigation Controller and viewcontroller (which does not work correctly):
I have been researching this and trying different things for a few days now and don't know what to try further. Everything appears to be set up identically and there is no layout or view altering code in the view controllers viewDidLoad or viewWillAppear: methods.
If there is anything obviously wrong (or not so obvious) I would appreciate a pointer. As far as I can tell it should work

Custom uitoolbar gets partly hidden

I'd like to add a custom UIToolbar to my UIViewController. In Interface Builder I add the uitoolbar at the top of my view, and it looks just fine. However, when I run the app in the Simulator it gets hidden by the default iphone bar (this one with the clock, battery status, etc.).
Here you can see how it looks like:
example http://www.cs.put.poznan.pl/jjurkiewicz/private/uitoolbar_hidden.png
Any ideas?
Seems like you're adding your view at coordinates (0,0), the top left of the screen. The view is then getting drawn behind the status bar. Make sure to add the view in the right position, to place it below the status bar it should be at (0,20)
You shouldn't hide the status bar needlessly - so use the IB inspector on the window/view, and under "Simulated Interface Elements", set status bar to anything bar "None". This should be how a new view is created in IB.
You can always just hide your status bar with the "Status bar is initially hidden" property in your Info.plist

Hiding/Showing Status Bar

I'm developing an iPhone app that switches from a table view to a landscape fullscreen view (similar to the YouTube app). When it does so, I want to hide the status bar, then display it again when switching back to the table view. I'm using setStatusBarHidden but that just seems to hide the status bar wihout enlarging the screen area; there's still a blank bar where the status bar was. If set the hidden status bar property in Info.plist then I get the enlarged screen area but when the status bar displays it overlays the view.
How do I hide the status bar in such a way that the full screen is available to my view when it's hidden and only the screen under the status bar when it's displayed?
TIA.
Craig
PS: I copy/edit this question from app discussion. do not find good solution
http://discussions.apple.com/thread.jspa?threadID=1580662&start=15&tstart=0
Your view controller should have wantsFullScreenLayout set to YES, as well as hiding the status bar: See UIViewController reference.
If there is anyone looking for a solution where the above solution does not work (and there is still an annoying blue 20px gap at the top), try putting this in the viewWillAppear on the implementation file of the view controller that you would like the status bar to be hidden.
self.navigationController.navigationBar.frame = CGRectOffset(self.navigationController.navigationBar.frame, 0.0, -20.0);
That literally took me 12 hours or so to fix, and that was the solution, so now i'm spreading the word in case anyone else has this annoying issue.

Navigation Bar at Bottom

Can we have NavigationBar at the bottom of the screen.As i have to display a image at the top of the screen.
You can put one anywhere but the system will not manage it for you.
If you want to put a nav bar at the bottom of the screen though, the chances are great you really want to have a toolbar, or a tab bar... navigation controllers are just not good on the bottom and users will think it's really wierd.
Can't you just make the nav bar transparent and have the image go behind it?
Try using UINavigationBar's initWithFrame: to position it how you would like. You could also put it inside a view which is located below your image.
It might be worth using a toolbar instead. Users are used to seeing the navigation bar at the top. The interface guidelines might "require" this too which could lead to fun when you submit your application to Apple.