Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the background color of a SFSafariViewController?

I understand that the code below changes the SFSafariViewController's tint color, but how do you change the background color of the navbar and tabBar?

SFSafariViewController *safariViewController = [[SFSafariViewController alloc] initWithURL:webpageUrl];
[safariViewController.view setTintColor:[UIColor blueColor]];

To clarify I want to change the semi-transparent white color to dark green?

enter image description here

Any help on this matter would be greatly appreciated.

Thanks!

like image 825
Adam Cooper Avatar asked Oct 20 '15 21:10

Adam Cooper


1 Answers

SFSafariViewController, as of iOS 10 SDK, has the preferredBarTintColor and preferredControlTintColor properties to control the tint color of bar items and the bars themselves, respectively.

like image 147
Léo Natan Avatar answered Oct 17 '22 08:10

Léo Natan