Hier ist eine weitere Option - Ich denke, das funktioniert nur, wenn Sie keine Transluzenz in Ihrer Navigationsleiste benötigen (ich nicht). Ich habe einfach eine 1 Pixel hohe UIView am unteren Rand der Navigationsleiste (1 Pixel unterhalb der Navigationsleiste) mit derselben Farbe wie meiner Navigationsleiste hinzugefügt:
UIView *view = [[UIView alloc] init];
[view setBackgroundColor:self.navigationController.navigationBar.barTintColor];
[self.navigationController.navigationBar addSubview:view];
[view mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.equalTo(@(1.0f));
make.leading.trailing.equalTo(self.navigationController.navigationBar);
make.bottom.equalTo(self.navigationController.navigationBar).offset(1.0f);
}];
Ich füge die Constraints mit Masonry hinzu.