Stellen Sie die Navigationsleiste transparent ein

//设置导航栏透明
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:[UIImage new]];
self.navigationController.navigationBar.translucent = YES;
self.navigationController.navigationBar.barTintColor = [UIColor clearColor];

///导航栏不透明
self.navigationController.navigationBar.translucent = NO;
self.navigationController.navigationBar.barTintColor = [UIColor whiteColor];

Nach dem Festlegen der Transparenz ist nur der Hintergrund der Navigationsleiste transparent, und die Schaltflächen und Titel in der Navigationsleiste werden weiterhin angezeigt. Anschließend können Sie die Navigationsleiste anpassen und so weiter.

Ich denke du magst

Origin blog.csdn.net/qq_28285625/article/details/109048557
Empfohlen
Rangfolge