I have a UINavigationController
with a UITableView
as my main menu. User clicks on a cell and a new view is pushed on the stack. In one case I push another UITableView
that needs a toolbar. So on that 2nd tableView's init I setup the self.toolbarItems
property with the correct items. But then I need to call [self.navigationController setToolbarHidden:NO animated:YES];
So it makes sense to call this in the viewDidAppear
or viewWillAppear
method. But I put it in those methods and find out (Also via NSLog) that they never get called. The same goes for hiding it in viewWillDisappear
or viewDidDisappear
. Why don't these methods get called? Where should I be doing this hiding/showing of the toolbar then?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
Yes Its true
you can do this by first write this code in
And then write the code which you want to write in viewWillAppear
i noticed the same issue in iOS7. When i'm using both tab bar (2 buttons A, B) and navigation controller.
A has two views. One with tableview and second displays data according to the selection from the table view.
B has is the only view.
Button which is refer to another separate view D, placed in both tab bar views (A & B) and in both views of A.
Problem arises when i click the button from tab item B,
viewWillAppear
andviewDidLoad
not called.So i solved this issue by
presentModalViewController:animated:
and to come back i useddismissModalViewControllerAnimated:
, just when i go to view D from tab item B.Although you solved your problem, in case someone comes along in the future another problem could have been that you forgot the animated: argument to either method - that is to say, the format of the method needs to look like:
I have noticed behavior where if a parent controller (like
UINavigationController
orUITabBarController
) never get'sviewWill/DidAppear
called on it, it won't call it on the child controllers either. So make sure that in the code where you create the parent controller, you callviewWillAppear
, show it, then callviewDidAppear
. Then it should make those calls on it's child controllers as is appropriate.Double check the parent controller is having those methods called, and call them yourself if they are not.