ios – 在SFSafariViewController上设置完成按钮颜色

ios – 在SFSafariViewController上设置完成按钮颜色,第1张

概述我正在使用SFSafariViewController访问从UITableViewController调用的网站.因为我的应用程序附带了非常轻松的感觉,我在AppDelegate中添加了以下代码行: self.window.tintColor = [UIColor whiteColor]; 运行SFSafariViewController时,我得到以下内容: 无论如何我可以将完成按钮颜色更改为蓝 我正在使用SFSafariVIEwController访问从UItableVIEwController调用的网站.因为我的应用程序附带了非常轻松的感觉,我在AppDelegate中添加了以下代码行:

self.window.tintcolor = [UIcolor whitecolor];

运行SFSafariVIEwController时,我得到以下内容:

无论如何我可以将完成按钮的颜色更改为蓝色(默认情况下)?

我在调用SFSafariVIEwController时尝试了以下 *** 作,但没有效果:

[self presentVIEwController:safariVC animated:YES completion:^{            safariVC.navigationController.navigationItem.rightbarbuttonItem.tintcolor = [UIcolor bluecolor];        [self presentVIEwController:safariVC animated:YES completion:^{            safariVC.navigationController.navigationbar.tintcolor = [UIcolor bluecolor];        }];

这些都不奏效.

我当然可以将应用程序保留为默认设置并从AppDelegate中取出白色设置,但我想在应用程序中使用这种方法,因为Blue在自定义主题中显得过于突出.

任何关于此的指导都将非常感激.

解决方法 您可以使用外观代理全局更改条形颜色:

尝试

[[UINavigationbar appearance] setTintcolor:[UIcolor bluecolor]];[[UIbarbuttonItem appearance] setTintcolor:[UIcolor bluecolor]];

别的尝试

[self presentVIEwController:safariVC animated:YES completion:^{         [safariVC.navigationbar setTintcolor:[UIcolor bluecolor]];    }];

别的尝试

在AppDelegate.m中的函数:

- (BOol)application:(UIApplication *)application dIDFinishLaunchingWithOptions:(NSDictionary *)launchOptions

我输入了以下代码:

//SFSafariVIEwController[[UINavigationbar appearanceWhenContainedIn:[SFSafariVIEwController class],nil] setbarTintcolor:[UIcolor bluecolor]];[[UINavigationbar appearanceWhenContainedIn:[SFSafariVIEwController class],nil] setTintcolor:[UIcolor bluecolor]];

或添加您的VIEwDIDLoad

[self.navigationController.navigationbar setTintcolor:[UIcolor whitecolor]];

迅速

UINavigationbar.appearance().tintcolor = UIcolor.bluecolor()UIbarbuttonItem.appearance().tintcolor = UIcolor.bluecolor()

别试这个

self.presentVIEwController(safariVC,animated: true,completion: {() -> VoID insafariVC.navigationbar.tintcolor = UIcolor.bluecolor()})

或者喜欢

func application(application: UIApplication,dIDFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {     UINavigationbar.appearanceWhenContainedIn(SFSafariVIEwController.self,nil).barTintcolor = UIcolor.bluecolor()UINavigationbar.appearanceWhenContainedIn(SFSafariVIEwController.self,nil).tintcolor = UIcolor.bluecolor()}

或者最后试试这个

self.navigationController.navigationbar.tintcolor = UIcolor.whitecolor()
总结

以上是内存溢出为你收集整理的ios – 在SFSafariViewController上设置完成按钮颜色全部内容,希望文章能够帮你解决ios – 在SFSafariViewController上设置完成按钮颜色所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1058791.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存