【问题标题】:In iOS14.7 beta, title of UIButton with image is truncated unexpectedlyiOS14.7 beta 中,带有图片的 UIButton 标题被意外截断
【发布时间】:2021-07-15 03:33:57
【问题描述】:

在 iOS 14.7 beta 5 和 RC 中,带有图像的 UIButton 的标题被意外截断。请看以下图片。

这发生在故事板布局和代码布局中。

故事板:

代码:


    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        
        let button = UIButton()
        button.translatesAutoresizingMaskIntoConstraints = false
        button.setImage(.init(named: "icon_check"), for: .normal)
        button.setTitle("Button", for: .normal)
        button.setTitleColor(.black, for: .normal)
        view.addSubview(button)
        
        NSLayoutConstraint.activate([
            button.centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: 0),
            button.centerXAnchor.constraint(equalTo: view.centerXAnchor, constant: 0),
        ])
    }

有人有解决办法吗?

【问题讨论】:

标签: ios uikit


【解决方案1】:

iOS14.7 公开发布版本已修复此问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-04-20
    • 2011-09-07
    • 2014-09-13
    • 1970-01-01
    • 1970-01-01
    • 2012-04-10
    • 1970-01-01
    • 2018-01-30
    相关资源
    最近更新 更多