首页 > 解决方案 > In a iOS app that supports CarPlay, why the CPBarButtons in the map navigation bar show always monochrome with a light blue color?

问题描述

I am trying to implement CarPlay for my navigation app, and I am experiencing a misbehaviour. Buttons that are instances of CPMapButton have their appearance on the map as expected. Instead, buttons in the CarPlay navigation bar (buttonType image), that are instances of CPBarButton, do not render well. They appear squeezed and always using a light blue color with no detail:

enter image description here

The icon I am using is the following:

enter image description here

Thanks for any help.

标签: swiftcocoa-touchcarplay

解决方案


事实上,这种不当行为是正常的。通过更好地阅读此链接,看来:

自定义图标(有时称为模板)会丢弃颜色信息并使用遮罩来生成您在屏幕上在导航栏或选项卡栏中看到的外观。

抱歉之前错过了...


推荐阅读