- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
Xcode 版本 11.0 beta 5 (11M382q)
当我的 View Controller 之一是顶部 View Controller 时,我正在使用新的外观 API 为条形按钮项目着色。我正在使用以下代码来执行此操作:
let appearance = UINavigationBarAppearance()
let attributes: [NSAttributedString.Key : Any] = [.foregroundColor : tintColor]
appearance.largeTitleTextAttributes = attributes
appearance.buttonAppearance.normal.titleTextAttributes = attributes
appearance.doneButtonAppearance.normal.titleTextAttributes = attributes
navigationItem.standardAppearance = appearance
这似乎适用于基于文本的栏按钮项目,但基于图像的栏按钮项目保持应用程序的默认色调。这是 iOS 13 测试版中的错误吗?我已经记录了一个雷达,但只是想看看是否有其他人遇到过这个问题或找到了解决方法。
正如您在下面看到的,后退箭头和加号按钮的颜色不正确。
最佳答案
你必须设置:
let backImage = appearance.backIndicatorImage.tint(with: tintColor)
appearance.setBackIndicatorImage(backImage, transitionMaskImage: backImage)
关于ios - UINavigationBarAppearance 不适用于基于图像的栏按钮项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57634813/
Xcode 版本 11.0 beta 5 (11M382q) 当我的 View Controller 之一是顶部 View Controller 时,我正在使用新的外观 API 为条形按钮项目着色。我
我有一个 iOS 应用程序,它使用自定义后 V 形作为导航栏中的后退按钮,并具有自定义背景颜色和阴影等。我想将背面指示器图像的颜色设置为默认蓝色以外的颜色。我如何使用新的 UINavigationBa
问题 我有一个应用程序,它为不同的流程提供不同颜色的导航栏。一些导航栏有浅色背景,需要黑色状态栏文本。其他的导航栏较暗,需要白色的状态栏文本。 作为迁移到 iOS15 的一部分,我更新了我正在开发的应
使用新的 UINavigationBarAppearance 时,似乎没有(或者至少没有明显的)方法来更新 View Controller 上的导航样式 apis .虽然这些 API 远远优于旧的样式
如何使用这个新对象来自定义 iOS 13 中的导航栏?我在 Objective-C 中尝试了以下代码,但它无法正常工作。当 View Controller 被推送或弹出到导航堆栈时,它只显示我的标题文
我有一个自定义颜色导航栏,我需要确保状态栏颜色设置为白色。在 iOS 13 之前,这很容易做到,这是 UIViewController 中的一个代码片段,它可以很好地完成这项工作: override
如果我像这样创建一个 UINavigationBarAppearance... let app = UINavigationBarAppearance(idiom: .pad) ...并为其配置背景颜
我是一名优秀的程序员,十分优秀!