[英]Set background color (not Text Color) of Back button in UINavigationBar IOS
对于navigationBar您应该setbackgroundImage
navigationController?.navigationBar.setBackgroundImage(UIImage(named: "your image name"),
forBarMetrics: UIBarMetrics.Default)
我尝试了Tint color
,但是无法使其正常工作。
我通过在UINavigationBar
的背面添加UIView
来实现。 在这种情况下,必须使用Autolayout
正确Autolayout
。
您可以使用自定义图像并手动设置标题
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:[UIImage imageNamed:@"customImage"]
forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.