嗨要从 UINavigation 栏中删除子视图,我正在使用以下代码。我在导航栏中将标签、按钮和 imageVIew 作为子视图。
for (UIView *view in self.navigationController.navigationBar.subviews) {
[view removeFromSuperview];
}
当我运行它时,它正在删除我添加为的导航栏的背景图像
[self.navigationController.navigationBar setBackgroundImage:[UIImagem imageNamed:@"header-background"] forBarMetrics:UIBarMetricsDefault];
after removing subViews i am adding the background agin,But it is not adding.
Is there any way to remove only subViews of navigation bar without removing the background.