I create a UINavigationController in storyborad,and UINavigationController control a TabbarController
If tabbarcontroller have three viewcontroller,each viewcontroller has a tableview use autolayout,when app launching,The ViewController from TabbarController which first show,index 0 as usual,the tableview view is complete show on this viewcontroller,but switch another index viewcontroller,the tableview is uncomplete show,it is hide by navigationbar,the autolayout was not take effect
thanks!
I deal with it by my self,If UITabbarController contains three UIViewControllers, each UIViewController have a UINavigationController
Related
I'm using UITabbarController in my project. All viewControllers are loading properly and the navigation from parentViewController in UITabbarController to a childViewController and then back to parentViewController when tabbaritem is tapped is working.
Now I want to reload the parentViewController if the user tap on the UITabbarItem while the parentViewController is already visible.
I'm not using and don't want to use viewwillappear method to reload the viewcontroller which will not work here in this case anyways as the view is already visible.
I have the next structure:
* TabBarController
- ViewController with TableView
- ViewController
When I select any row on the TableView, the segue forwards me to the ViewController. On the ViewController with the TableView, I see the BottomBar, but after the segue it disappears.
How can I keep it on my ViewController? I've even putted the last ViewController in NavigationController, but it did not help me, too.
How can I fix it?
Your hierarchy should look like this:
* TabBarController
- NavigationController
- ViewController with TableView
- ViewController
Using a Show segue with an UINavigationController pushes the destination view controller onto the navigation stack. However, most other view controllers present the view modally (i.e. by sliding over the source view controller) with Show, which is why your tabbar disappears.
uncheck hide bottom bar when pushed from your view controller in story board
We are trying to programmatically load a specific UITabBarView within the UITabBarController that isn't the first UITabBarView. We have a UIViewController with a UIButton that should fire an action to load the desired tab from the UITabBarController. Here is a screenshot of the storyboard showing a UIViewController that loads a UITabBarController:
Assuming that the View Controller is loading the TabBarController with a segue, just override -prepareForSegue in the view controller, get a reference to the TabBarController using segue.destinationViewController and change the selectedIndex to switch views
My viewcontroller subview other viewcontroller and I Want to go to from that subview (ViewController) to other viewController. ? with segu o or open with nib any suggest ?
Controller1 has controller2 as subview and want to go to from controller2 to controller3
I would recommend using a UIContainerView, these are views that contain a view controller. Just try playing around with one by dragging it onto the Main.storyboard. You can make one visible and make the others visibility = false and visa versa.
I am having some issues on UI design.
Alternative 1:
UINavigationController
TabBarController
MapViewController
UINavigationContoller
UITableViewController
DetailViewController
Alternative 2:
UINavigationController
TabBarController
MapViewController
UITableViewController
DetailViewController
In alternative 1 in the navigationitem of DetailViewController the backButton and the title are not being shown but I have the lower tabbar.
In alternative 2 in the navigationitem of DetailViewController the backButton and the title are visible but I am missing the lower tabbar.
Is there any way to have both features of alternative 1 & 2?
I need the the top most Navigation Controller because in the TabBarViewController I have a LeftBarButtonItem showing a side menu (SWRevealViewController).
EDIT
Code in TableViewController
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
poiDetail = [poiManager.listOfPois objectAtIndex:indexPath.row]; // does not work with regions-sections
[self performSegueWithIdentifier:#"poiDetail" sender:self];
}
where "poiDetail" segue is a push e.g. 'Show' segue.
Yes I implemented same scenario and facing the same issue, Fortunately I am able to solve this in my application,
I am suggesting Alternative 1
You can set Initial UINavigationController in AppDelegate and maintain application flow with same navigation controller till nested UINavigationController. And set TabBar controller as a RootViewController
In RootViewController of nested NavigationController please hide AppDelegate navigationController's NavigationBar. So you are able to resolved issue of Alternative 1 that you are facing.
I referred this library: https://github.com/juliorimo/CustomTabBar-iOS
(Note: This library is just one UINavigationController and TabbarController further Nested UINavigationController flow you have to maintain)
Hey I propose Alternative 3:
UINavigationController
Tab Bar Controller
Nav Controller
Map View Controller
Nav Controller
Table View Controller
Detail View Controller
You essentially want the two View Controller managed by the Tab Bar Controller to be wrapped in Nav Controllers