我有一个 UIBarButton 项目设置为 UINavigationBar 上的右键。我还有一个 UISegmentedControl 设置为 titleView。这些都是使用 Interface Builder 添加的。
这是我用来删除项目的代码:
[self.navigationItem setRightBarButtonItems:nil animated:YES];
[self.navigationItem setTitleView:nil];
问题是,既然我已将它们设置为nil
,如何将它们添加回 UINavigationBar?
项目是self.barAdd
和self.segLibrary
。如何从 .xib 重新加载它们?