I run into a layout problem in iOS 7:
To reproduce create a simple master-detail-app and insert this line in MasterViewController.m :
self.navigationItem.prompt = @"Master";
and this in DetailViewController.m :
self.edgesForExtendedLayout = UIRectEdgeNone;
Both lines in viewDidLoad
.
The detail view's frame does not update correctly when the navigation bar shrinks to its normal size.
How should I fix this?
My current solution to this is to remove the prompt in the master view's viewWillDisappear:
- (void) viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
self.navigationItem.prompt = nil;
}
Then just set it again in the viewWillAppear. There should be a better method, however.
来源:https://stackoverflow.com/questions/18782205/ios-7-detail-layout-when-master-has-navigation-bar-prompt