I am having the following problem while adding a subview to navigation controller. I even have tried to modify the Y location of frame before and after adding the subview but not effective.
Also tried to put a status bar on the child view but nothing is working.
Many Thanks.
You have a problem with a fullScreen IB checkbox or a fullscreen property set programmaticaly. Don't you call somewhere something like viewController.setStatusBarVisible = NO. Check it, I had the same problem.
EDIT : Does those questions / anwers help ?
iPhone - ModalViewController not raising to top of the screen
iPhone - displaying NavigationBar on a fullscreen modalView makes it go down with transparent space on top
Thank you very much everyone of you. I don't know what was the issue but instead of adding subview now I am using pushViewController and I am pushing the viewcontroller to the parent navigation controller. This solved the issue.
Thank you all of you once again.
Related
I'm getting a little confused when it comes to UINavigationBar.
I set it up programatically and what it does is it pushes my viewController down (So things near the bottom of the view that are seen in storyboard are not seen after launching the app)
The question is - is there a way to tell my navigationbar not to push down my view but to sit on top of it instead?
I've been trying to use bounds and frame for this but it did not help.
Playing with self.navigationController?.navigationBar.translucent did not help neither.
In your storyboard, the attributes inspector for the problematic view controller. Disable adjust scroll view insets.
Think this is a bug on apple's part. It occurs very frequently for me.
I am currently developing as app for iPad. And I need to create a tabbar. The problem is that, for design purposes, I need the tabbar to be on the top half of the screen and not on the bottom as it is on the default tabbar controller.
Once the tabbar is on top I want that when a button is touched, the subview bellow the tab is changed. Furthermore, the subview that should be loaded was alson designed inside the storyboard. The following sketch shows what I want it to look like:
On my research I found a solution (here) for putting the tabbar on top. Now my problem is on loading a subview bellow it.
I tried it with [self.view addsubview:theNameOfTheViewCreatedINStoryboad.view] but the application simply hangs when I press the button.
I think that is because I am not specifying anywhere what should be the dimension of the new view or where on the scree should it be placed. The reason for that is because I do not know where it should be done.
Can anyone give me some lights on this matter? Is the referred approach the best one for putting a tabbar on top? How can I solve the subview problem?
Glad to see you are using a toolBar and not a tabBar. Even better would be to create a custom content view controller.
You should be looking into using containment:
UIViewController containment
How does View Controller Containment work in iOS 5?
positioning UIViewController containment children
check out the docs
I've made a custom class that consist in a customized animated toolbar instanced in all my views. It works well in classic UIview using [view addSubview:]. The bar stays between the tabbar and the view. But in my tableviewcontroller, it follows the cells when I swip them.
I don't have Xcode right here so I can't post any explicit code, but I'm just looking for a hint.
Thanks
PS: I've tried to search it over stack and Google, but I think I use the wrong keywords (not so good english :p)
Which view did you add your bar?
Try add it to the superview of the tableview instead of tableview itself.
I've created a simple application with a single view controller and removed the status bar so I can use the full height of the screen. The view controller's xib file loads perfectly well, displaying a backdrop image very nicely. I then added a custom view object which will be handling certain graphical tasks directly for me, and asked it to initialize itself with the custom view's frame rectangle. I did this in the 'viewDidLoad' method for the view controller. For some strange reason though, the view controller is reporting its frame rectangle as if the status bar were still visible, despite the fact that I hide it before creating the view controller. Can someone explain why, and maybe suggest a workaround?
-Ash
Oops, it's always the simple things isn't it? I just forgot this command:
viewHolder.wantsFullScreenLayout = YES;
Hey everyone, running into a bit of an issue,
I have created all my views through IB, with the main window having a NavigationController, and a TabBarController which loads a TableViewController in its first tab.
The problem happens when i use the searchbarcontroller in the navigation controller, everything works fine with the exception that when the navigation bar at the top disappears, the table expands too high, and i can't figure out what im doing wrong.
Attached is an image of what im referring to, any help would be greatly appreciated.
alt text http://img263.imageshack.us/img263/4706/picture1ot.png
Some more information:
i have my MainWindow with a UINavigationController, and a UITabBarController. On the first Tab, i have it loading another nib "AVN_TableController" which is a UITableViewController nib, with the Searchbar delegate.
If you've set your view sizes correctly in Interface Builder and are using the "Simulated Interface Elements" to cause the status bar, navigation bar, and tab bar to display, it should work correctly. If not, then what comes to mind is this issue where displaying an action sheet has it's tappable rectangle offset by the height of the tab bar because it is added to the wrong view. Not sure if that would apply here, but it's at least something to consider.
I ended up going the route of creating my own tabbarcontroller, as that was causing the issue.