向后按钮位于中间而不是左侧-SWIFT

时间:2019-12-29 19:14:48

标签: swift xcode button uinavigationcontroller back

我正在尝试将后退按钮图像更改为我拥有的自定义图像,但它始终出现在导航栏的中央。我不确定问题是什么,似乎无法解决。有什么建议吗?

这是当前显示的内容: enter image description here

这是我在应用程序委托中编写的代码:

    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
    }

0 个答案:

没有答案