gpt4 book ai didi

swift - iOS 11 的默认导航样式错位

转载 作者:行者123 更新时间:2023-11-28 06:10:16 24 4
gpt4 key购买 nike

在我的应用程序中,我使用以下代码添加默认导航。

enter image description here

self.navigationController?.navigationBar.barStyle = UIBarStyle.default
self.navigationController?.navigationBar.backgroundColor = UIColor.clear
self.navigationController?.navigationBar.isTranslucent = false
self.navigationController?.navigationBar.barTintColor = // my color
self.navigationController?.navigationBar.tintColor = // my color
self.navigationController?.navigationBar.shadowImage = UIImage()

此代码在 iOS 10 之前工作正常。但在 iOS 11 中,后退图标不在中心。

我检查了关于 View 标题的其他类似问题 herehere但找不到任何解决方案。谢谢。

最佳答案

所以我找到了this回答,我也做了同样的事情。

AppDelegate 中删除这一行对我有用。

UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment (UIOffsetMake(0, -60), for: .default)

关于swift - iOS 11 的默认导航样式错位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46918095/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com