(1)self.navigationItem 是对当前view的导航栏里面的内容进行定制。
(2)而对于self.navigationController.navigationItem,苹果则有这样一段说法:
A UINavigationController is a subclass of UIViewController. As such, it has its own
independent navigationItem property, which it inherited from UIViewController. You should ignore this property, as it would only be used if you were to embed a navigation controller inside another navigation controller (which nobody in their right mind would
ever do).
从上面的这段话,我们可以看出,基本这种使用方式是被废弃的。
本文探讨了在iOS开发中如何正确使用self.navigationItem来定制当前view的导航栏,强调了对于self.navigationController.navigationItem的使用是被废弃的方式,并解释了原因。
1795

被折叠的 条评论
为什么被折叠?



