Navigation bar resetting its frame - objective-c

I have a TabBar which has been created programmatically. In the view controllers of this tab bar I am trying to reduce the size of navigation bar using -
"self.navigationController.navigationBar.frame = CGRectMake(0, 20, 320, 30);"
For the first time the view controller loads the navigation bar is displayed with the dimensions specified by me, but after that it automatically resets its dimensions.
An example having this issue can be downloaded from http://dl.dropbox.com/u/2647092/iPhone_tabbar_example.zip
To replicate this issue in this example follow these steps -
open and run the project
in the simulator click on Tab1 then click on Tab2 again click on Tab1 the Navigation bar of Tab1 would be resized to its default dimension
Is there any thing wrong I am doing in this case or is there an alternative method to do this?
Please let me know.
Thanks,
Yogesh

Got the solution to this problem...instead of resizing the navigation bar in viewWillAppear resize it in the viewDidAppear

Related

Modal View Controller Slides Underneath Status Bar in iOS 7

When I use a modal view controller in iOS7 it slides underneath the status bar. Is there a way to stop that from happening without having to adjust the view based on what os it's running on? You can see that the Close button is pushed up underneath the Carrier text on the status bar. Is there any way to get the modal view controller to recognize my status bar?
Have you seen this? UINavigationBar/Status Bar issue in IOS7
There are a couple of things you can try, but I think what you're looking for is here, in the iOS7 Transition Guide: https://developer.apple.com/library/ios/documentation/userexperience/conceptual/TransitionGuide/AppearanceCustomization.html

uibutton dosnt respond to touch when at a location

Bit of a strange one.
I have a UIButton which works when located anywhere on the view except the top left hand corner when in landscape mode.
I have a navigation bar with a back button nested in the same area but when the the video enters full screen and playback state changes this navigation bar is hidden.
any ideas?
As thought, the problem was occuring due to the hidden navigation bar and the navigation item located in the same place.
The only solution i can find was to remove the navigation bar from superview then add it back when needed.
Your view's hierarchy is not properly configured. To properly configure your hierarchy, you need to navigate to either the xib or storyboard that you're working with, and re-order the button so that it's on top of anything that falls within it's similar bounds. A common example is that you added a UIView, which is clear, and you had the button underneath it, and now you can't interact with it even though you can't see it.

Shrink detail view controller animated when menu slides at UISplitViewController

I'm working with UISplitViewController on iPad and want to override it's behavior. When user taps on bar button, there are slides menu from the left side of screen. But it overlaps detail view controller. Can I make it so the detail view controller shrinks animated when the menu appears and expands when the menu disappears?
I don't think it's natively possible, so I think of 2 ways of doing this
1 - try and error: study the split delegate calls to see when you should shrink the content in your detail and tune it up until it looks smooth
2 - create your own "split" controller and do all the resizing/presenting by yourself

Putting a toolbar directly under a navigation controller without hiding the content underneath the toolbar

I am trying to put a toolbar directly beneath a navigation bar but I need the toolbar to not hide the content from the view directly beneath it. My quick solution was to set the navigation controller's native toolbar to visible, which works and properly resizes the view beneath it so that it doesn't let anything hide behind it, BUT the default toolbar shows at the bottom of the screen.
I need it to be at the top, just under the nav bar. I figure the easy solution would be to change the frame of the default toolbar (which I don't know how to do) OR to position a new instance of the toolbar onto the view (which works but it hides the content beneath it) but have it resize the views below.
Please see the following image that I found to see what I'm trying to do. (note how the tableview's first row starts UNDER the tab bar)
Thanks!!!
You are confusing two things. The NavigationController toolbar property IS the bottom bar, any toolbar that you add to a view has nothing to do with the nav controller but is a property of that view.
If you have your own toolbar at the top of a view you need to move the rest of the view content down or set that toolbar to translucent if thats what your looking for.
Again the nav controller toolbar is always the bottom bar, the toolbar you drop in IB is just a toolbar for that view that you can put anywhere.
I don't believe you can change the frame of the default toolbar. You will need to create your own instance of a toolbar, position it at the bottom of the navigation bar and resize your tableView to fit below.
We can't see how you have your views set up but if you are starting with a view that is subclassed as UITableViewController you will have trouble doing that. What you want is to start with a UIViewController as your master controller, add a tableview and toolbar as subviews. Then position and size them as appropriate.
If you are hiding and showing the toolbar you will create a method to move it up under the navigation controller and again resize the tableview.

how to remove the navigation bar for individual tabs from interfaceBuilder

i created a tabbar with navigation controller for individual tabs in xcode 4.0 using InterfaceBuilder.previous week ive changed to ios5 and i m not able to find the option to change the navigation controller to view controller in IntefaceBuilder.could u guys help me out by providing me a screen shot
Drag the controller type onto the tab bar at the bottom and delete the unneeded ones.