The solution I can think of is to subclass the UIView wizard and implement viewDidMoveToSuperview to set the view frame from the height of the navigation bar to the end of the supervisor. Since the navigation bar is not translucent, your task is simpler, since you do not need to take into account the guidelines for placing and pasting content.
A few comments. When pressed and popped, the system moves your view of the controller controller to another supervisor for animation, and then returns it to the hierarchy of the private representation of the navigation manager. Also, when the view goes beyond the view hierarchy, the supervisor becomes nil .
Here is an example implementation:
@interface LNView : UIView @end @implementation LNView - (void)viewDidMoveToSuperview { [super viewDidMoveToSuperview]; if(self.superview != nil) { CGRect rect = self.superview.bounds; rect.origin.y += 44; rect.size.height -= 44; [self setFrame:rect]; } } @end
This is not an ideal implementation, because it uses a fixed value for the height of the navigation bar, does not take into account the possible toolbar, etc. But you can add all this as properties to this view in viewDidLoad , before it starts to go into the hierarchy of views, sets the parameters according to your needs.
Leo natan
source share