Search code examples
iosswiftuitableviewuipickerview

UIPickerView in UITableViewCell showing behind next Cell


I have a tableview with a number of custom cells. The problem I am having is that the cell with the pickerview is 'bleeding' behind the neighboring cell.

Once I push another view controller and pop back, the neighboring cell is properly opaque until I manipulate the picker, at which point the issue materializes again.

The cell is, in fact, opaque. I have set it as such in both the storyboard and code. I have also tried setNeedsLayout and layoutIfNeeded in cellForRowAtIndexPath.

UIPickerView values bleeding to next cell


Solution

  • Set clipsToBounds property to true to each cell in the method cellForRowAtIndexPath.

    You can set this property in the Storyboard if you are using prototypes cells.