gpt4 book ai didi

ios - 如何摆脱此按钮中的模糊 Logo

转载 作者:行者123 更新时间:2023-11-28 05:58:41 25 4
gpt4 key购买 nike

这是我的图片:

enter image description here

我在按钮中使用 128 x 128 像素的 png 文件图像作为我的 Logo ,但它看起来仍然很糟糕。

这是我的代码:

let createButton = UIButton(type: .system)
createButton.setImage(#imageLiteral(resourceName: "navigation.png").withRenderingMode(.automatic), for: .normal)
createButton.tintColor = UIColor.red
createButton.frame = CGRect(x: 0, y: 0, width: 34, height: 34)
createButton.contentMode = .scaleAspectFit
createButton.backgroundColor = UIColor.clear
navigationItem.leftBarButtonItem = UIBarButtonItem(customView: createButton)

最佳答案

您需要使用 1x、2x、3x 图像取决于按钮大小。假设按钮大小为 50*50,那么您需要分别使用 50*50、100*100、150*150 的图像作为 1x、2x、3x。

关于ios - 如何摆脱此按钮中的模糊 Logo ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50576220/

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