cuốn sách gpt4 ai đã làm

ios - ActionSheet 滞后

In lại Tác giả: Walker 123 更新时间:2023-11-28 15:21:08 27 4
mua khóa gpt4 Nike

我有 ActionSheet 的代码,它可以连接的东西有点慢?

@IBAction func showAction(_ sender: UIButton) {
let actionSheetController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
actionSheetController.addAction(
UIAlertAction(title: NSLocalizedString("Copy", comment: ""), style: .default, handler: { [weak self] _ in
guard let strongSelf = self else { return }

UIPasteboard.general.string = strongSelf.displayResultLabel.text

let alert = UIAlertController(title: NSLocalizedString("Copied to clipboard", comment: ""), message: "", preferredStyle: .alert)
let when = DispatchTime.now() + 0.5
DispatchQueue.main.asyncAfter(deadline: when){
alert.dismiss(animated: true, completion: nil)
}
self?.present(alert, animated: true, completion:nil)
})
)
actionSheetController.addAction(UIAlertAction(title: NSLocalizedString("Cancel", comment: ""), style: .cancel, handler: nil))

present(actionSheetController, animated: true, completion: nil)
}

câu trả lời hay nhất

更改 animated: true

present(actionSheetController, animated: true, completion: nil)

đến animated: false 省略延迟或动画

present(actionSheetController, animated: false, completion: nil)

关于ios - ActionSheet 滞后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45982535/

27 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress