UISegmentedControl图像在iOS 13上始终为黑色

问题描述 投票:-1回答:1

我正在使用带有图像的UISegmentedControl。我正在尝试使用模板图像和tintColor,selectedSegmentTintColor和backgroundColor都具有不同的颜色,因此都应该可见,但是图像始终为黑色。此示例在这里:http://github.com/tomspee/SegmentedControl13

有没有办法在UISegmentedControl上修复黑色图像?

这就是我现在在iOS 13上看到的内容:

enter image description here

这是我在iOS 12中拥有的,也想在iOS 13上获得:enter image description here

要添加:我已经实现了下一个代码以选择退出暗模式:

<key>UIUserInterfaceStyle</key>
<string>Light</string>
ios swift uisegmentedcontrol ios13
1个回答
-1
投票

[有两个原因在iOS 13中始终显示黑色。有了iOS 13,我们也有了黑色主题。如果您想限制黑色主题。您可以使用下面的代码。

<key>UIUserInterfaceStyle</key>
<string>Light</string>
© www.soinside.com 2019 - 2024. All rights reserved.