Victor17
Victor17

Reputation: 51

Changing the size of my UIPickerView in Swift

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.

Upvotes: 1

Views: 2986

Answers (1)

Tobias
Tobias

Reputation: 4397

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.

Upvotes: 1

Related Questions