【发布时间】:2016-12-28 11:30:41
【问题描述】:
我正在尝试将UIPickerView 放入UIAlertView,但我似乎无法正确调整它的大小。这是我得到的:
这是我的代码:
let alertView = UIAlertController(title: "Select item from list", message: "", preferredStyle: UIAlertControllerStyle.alert)
let pickerView = UIPickerView(frame: CGRect(x: 0, y: 0, width: 250, height: 60))
pickerView.dataSource = self
pickerView.delegate = self
alertView.view.addSubview(pickerView)
let action = UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil)
alertView.addAction(action)
parent.present(alertView, animated: true, completion: nil)
【问题讨论】:
-
给picker增加更多的高度,60不够,试试300之类的
标签: swift uipickerview uialertview