【发布时间】:2017-03-10 09:46:00
【问题描述】:
我想在 UIAlertbox 中添加图片,所以我添加了以下代码。
let alertController = UIAlertController(title: "Gender", message: "" , preferredStyle: .alert)
// Create the actions
let okAction = UIAlertAction(title: "Female", style: UIAlertActionStyle.default) {
UIAlertAction in
// exit(0)
debugPrint("Press OK")
}
let cancelAction = UIAlertAction(title: "Male", style: UIAlertActionStyle.cancel) {
UIAlertAction in
}
// Add the actions
okAction.setValue(#imageLiteral(resourceName: "female_image"), forKey: "image")
cancelAction.setValue(#imageLiteral(resourceName: "male_image"), forKey: "image")
alertController.addAction(okAction)
alertController.addAction(cancelAction)
当我运行应用程序时,只出现一个图像。这有什么问题?
请有人帮帮我吗?
【问题讨论】:
标签: swift3 uiimageview uialertview uialertcontroller