2

如何更改只有UIActivityViewController的颜色?更改UIActivityViewController的导航栏颜色

我想改变只是UIActivityViewController的UINavigationBar的使用类似的颜色:

self.activityViewController.navigationController.navigationBar.barTintColor = [UIColor greenColor]; 
+0

[毛刺与UIActivityViewController(http://stackoverflow.com/questions/21764552/glitch-with-uiactivityviewcontroller) – Pawan

回答

1

我建议创建和使用展示您UIActivityViewController前更改UINavigationBar的背景色:

[UINavigationBar appearance].backgroundColor = [UIColor greenColor]; 

HTH

+0

的可能重复这似乎并不为我的按钮点击方法插入时它的工作那就调出ActivityView:我把它插在我的[self presentViewController:activityViewController animated:YES completion:nil]上面;甚至尝试:[self presentViewController:activityViewController animated:YES completion:^ {[self presentViewController:activityViewController animated:YES completion:nil];}]; – Bobi

+1

我很抱歉,我提到了错误的属性。请试着设置颜色:'[UINavigationBar appearance] .barTintColor = [UIColor greenColor];' – anka

+0

这与我使用的效果相同。不幸的是,它也改变了任何childViewController tintColor,我正在避免这种情况。 – Bobi

0

下面的代码也许可以帮助您:

[[UINavigationBar appearanceWhenContainedIn:[UIActivityViewController class], nil] 
      setTintColor:[UIColor greenColor]]; 
+0

我不认为这段代码会起作用,因为'UINavigationBar'不是'UIActivityViewController'的子类。 'UIActivityViewController'将被嵌入到'UINavigationController'中。 – anka