iOS 13 - UIBarButtonItem 尺寸太小

iOS 13 - UIBarButtonItem size too small

我正在将我的应用更新为 iOS 13,我的 UIBarButtonItems 更小。

iOS13截图:

iOS12截图:

看看暂停图标。变小了。

我的代码:

[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPlay target:self action:@selector(botaoPressionado:)];                                                      

有什么解决办法吗?

iOS13 中的原生图像已更改。 UIBarButtonSystemItemPlay 图片已更改。与您使用 UIBarButtonSystemItemAction 图像的第二个相同。

Xcode 10 - iOS 12:

Xcode 11 - iOS 13:

如果您想保持两者的一致性 iOS 然后在栏按钮中添加自定义图像。

  • How to set image for bar button with swift?

编辑

更改条形按钮项目色调颜色:

barButtonItem.tintColor = .black

如果要使用自定义图片,则设置栏按钮系统项属性自定义和:

barButtonItem.image = UIImage(named: "imageName")?.withRenderingMode(.alwaysOriginal)

在 iOS 13 中使用新的 SFSymbols,图标大小根据 space 调整。

在这种情况下,音量条的大小是固定的,但它太大了,所以它挤压了 play/pause 按钮。

修复了减小音量条宽度的问题,现在看起来像这样: