Quite tricky.
You need to make sure that you are not using the same UIView for multiple cells. The view is resized as soon as it's used once and will create problem with the sizes.
The solution is to create a separate background view for each cell like so: