我正在尝试将后退按钮图像更改为我拥有的自定义图像,但它始终出现在导航栏的中央。我不确定问题是什么,似乎无法解决。有什么建议吗?
这是我在应用程序委托中编写的代码:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
// back arrow stuff currently irrelevant
let backArrowImage = UIImage(named: "BackBTN")
let renderedImage = backArrowImage?.withRenderingMode(.alwaysOriginal)
UINavigationBar.appearance().backIndicatorImage = renderedImage
UINavigationBar.appearance().backIndicatorTransitionMaskImage = renderedImage
return true
}