裁剪的字符 - iOS11 - 警报对话框。 如何解决?
[
func settingsButtonPressed() {
let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
let closeAction = UIAlertAction(title: "Anuluj", style: .cancel) { (action) in
//do nothing
}
alert.addAction(closeAction)
let restorePurchases = UIAlertAction(title: "Przywróć zakupy", style: .default) { (action) in
self.restorePurchases()
}
alert.addAction(restorePurchases)
let refreshCatalogs = UIAlertAction(title: "Odśwież", style: .default) { (action) in
self.collectionView.reloadData()
}
alert.addAction(refreshCatalogs)
let delPubs = UIAlertAction(title: "Usuń publikacje", style: .destructive) { (action) in
self.deletePublications()
}
alert.addAction(delPubs)
present(alert, animated: true, completion: nil)
}
答案 0 :(得分:0)
尝试使用NSLocalizedString
而不是硬编码值。 Usage article here
然后只需定义你的标题:
let cancelButtonText = NSLocalizedString("Cancel", comment: "")
并设置它:
let cancelAction = UIAlertAction(title: cancelButtonText, style: .cancel, handler: nil)