需要在swift 控制器下重新对backIndicatorImage赋值
if #available(iOS 13.0, *) {
guard let img = UIImage(named: "nav_bar_icon")?.withRenderingMode(.alwaysOriginal) else {
return
}
letappearance =UINavigationBarAppearance()
appearance.backgroundColor= .white
appearance.titleTextAttributes = [.foregroundColor: UIColor.black]
appearance.setBackIndicatorImage(img, transitionMaskImage: img)
let back = UIBarButtonItemAppearance()
back.normal.titleTextAttributes = [.foregroundColor: UIColor.clear]
appearance.backButtonAppearance= back
navigationController?.navigationBar.tintColor = .white
navigationController?.navigationBar.standardAppearance = appearance
navigationController?.navigationBar.compactAppearance = appearance
navigationController?.navigationBar.scrollEdgeAppearance = appearance
}