2016年10月30日 星期日

swift3 Day16 UIAlertController 中放進 UIPickerView

要在 alert 中加進 pickerView 可以直接 add 就好:



alertController.view.addSubview(myPickerView)



 



加進去之後 pickerView 的 x, y 會以 alert 的位置開始算,



有點像 margin-left, margin-top 



大小、位置要在不同裝置使用很不好控制!



 



 



參考來源:



https://itisjoe.gitbooks.io/swiftgo/content/uikit/uialertcontroller.html



https://itisjoe.gitbooks.io/swiftgo/content/uikit/uipickerview.html



http://stackoverflow.com/questions/33233894/want-to-show-uipickerview-in-uialertcontroller-or-uipopovercontroller-swift




0 意見:

張貼留言