Changing the size of my UIPickerView in Swift

北城余情 提交于 2019-12-24 13:19:01

问题


I have a UIPickerView that I would like to change the size of frame. It seems that no matter how small I want it there is set minimum size that I can't go smaller than. I have seen other posts about this but they are very old and the code is much different now. I know how to adjust the height and width of the rows in the picker view but not the frame itself. Even in the Frame Inspector no matter what I change on the height and width it will not go smaller than a certain size.


回答1:


You can't change the size of a UIPickerView without doing strange hacks. The class is written for specific dimensions and if you do hack it to change the size it leads to weird issues.

I would suggest you use the iCarousel library to implement a custom picker view.



来源:https://stackoverflow.com/questions/30386005/changing-the-size-of-my-uipickerview-in-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!