我的代码是这样的:如何使用默认值在alertView中创建tableView?
let alrController = UIAlertController(title: "Membri", message: nil, preferredStyle: UIAlertControllerStyle.actionSheet)
tableView.backgroundColor = UIColor.white
alrController.view.addSubview(tableView)
let cancelAction = UIAlertAction(title: "Esci", style: UIAlertActionStyle.cancel, handler: {(alert: UIAlertAction!) in})
alrController.addAction(cancelAction)
self.present(alrController, animated: true, completion:{})
我想填充(但我不知道怎么做)的tableView
这个数值在我的数组:names["name1","name2","name3"]
有人能帮助我吗?
你需要添加这些值作为alertView中的选项? –
请参阅此链接(https://stackoverflow.com/questions/29896005/ios-8-and-later-uitableview-inside-an-uialertcontroller) –
'UIAlertController'实际上不支持添加子视图。 – rmaddy