8

I have an app that has a list of UITableViewCells. By default, the cells are set to a certain height (lets say 100) to show only some basic information. When the user clicks on a cell the height changes to 150 to show more actions that were previously not seen. This works without a problem on iOS 7.0.0-7.0.5. I'm testing on an iPhone 5s running iOS 7.1 beta 5 and seeing some drawing issues with the cells.

Here's how it looks on iOS 7.0... versions which is what is expected. When the cell is collapsed, the buttons that are positioned past the height of the cell are hidden and when the cell is expanded to a height to show the buttons, they are visible.

Cell expanded: enter image description here The following is the cell when collapsed:

iOS 7.0.5 with the correct behavior

Here are the issues I'm seeing with iOS 7.1 beta. Im curious if this is just something that is a problem with the beta or if I'll have to rethink how this is being coded currently. As far as I can tell this has been present since the first beta of 7.1.

As you can see, the button which was previously hidden is now still showing even though the cell is collapsed. enter image description here

Is this an issue with the beta that anyone else has seen or is this expected behavior now? Thank you for you help!

Made2k
  • 222
  • 3
  • 15

1 Answers1

20

Try setting clipsToBounds=YES in your cell as it may be drawing outside of it bounds.

cell.clipsToBounds =YES

Also check that the cell height is actually collapsed.

AppHandwerker
  • 1,758
  • 12
  • 22
  • 2
    The clipsToBounds was it! Kind of odd that the 7.1 beta didn't do that. My guess would be they just changed the default behavior of cells and turned off clipsToBounds. But either way, thanks a lot! – Made2k Feb 07 '14 at 16:45
  • Depends on what you're doing sometimes it's what you want. ;) Glad that helped. – AppHandwerker Feb 07 '14 at 16:47
  • my cells were flickering , this also solved the problem. Apparently their heigh was too big – João Nunes Mar 19 '14 at 09:27
  • side note : clipsToBounds will make the cell not render any shadow effects as shadows are usually drawn outside the cell's bounds. Mentioned so you wont go pulling hair when shadows wont work if you decided to add it later :) – nsuinteger Mar 24 '14 at 06:59