iOS 16.0 does not allow arbitrary UIPickerView heights

I have a Swift 5 iOS project in XCode 13.4 containing a View Controller with 5 UI PickerView controls, each with height set to 74 using Interface Builder. The view controller is shown as a popover. When I run the project using an iOS 15.5 simulator, the UIPickerViews appear as designed. When I use an iOS 16.0 simulator I see 5 console messages of the form [UIPickerView setFrame:]: invalid size {204,74} pinned to {204,162} and the UIPickerViews are much larger and their arrangement is not as designed. Has iOS 16.0 returned to only allowing a small number of UIPickerView heights rather than allowing an arbitrary height?

Post not yet marked as solved Up vote post of SimonKravis Down vote post of SimonKravis
1.7k views
  • If I set the UIPickerView height to 162 I get the bizarre message [UIPickerView setFrame:]: invalid size {204,162} pinned to {204,162} but the height does not change. Looks like an Apple bug.

Add a Comment

Replies

Will Apple fix this quickly? It has seriously broken my app, which I just put on the App Store. It worked just fine before upgrading to iPadOS 16.1. Is there any good workaround, or can we expect it to be fixed quickly by Apple?

hi, I had the exact same problem. you can use constraint layout as workaround. the bug only happens with autolayout.

I have the same problem. Both of my Pickerviews spill outside their defined sizes and make my app interface look bad. There is no option for a "constraint layout." Only autoresizing mask and inferred autoresizing mask. The other problem is the picker view does not show up where its X and Y coordinates indicate, but about 50 below the Y coordinate.