iOS8 更新 UIActionSheet, 讓我們不能在裡面加入 subclass, 他們覺得我們誤用了 UIActionSheet,

所以嚴格的讓 UIActionSheet 加入 subclass 都無法 work

 

UIActionSheet is not designed to be subclassed, nor should you add views to its hierarchy. If you need to present a sheet with more customization than provided by the UIActionSheet API, you can create your own and present it modally with presentViewController:animated:completion:.

 

好,  在 UIActionSheet 裡無法顯示 UIPickerView 那我們該如何解決這個問題呢?

一個解決方式就是照他說的改用 presentViewController, 不過這樣顯示就改變了

另一個是使用 ActionSheetPicker 3.0, 可以長得跟以前一樣

而且裡面 Example 很多, 使用也不會太複雜

快來使用吧~

 

Add UIPickerView in UIActionSheet from IOS 8 not working

arrow
arrow
    全站熱搜

    JohnDX 發表在 痞客邦 留言(0) 人氣()