iOS 7.1 beta5 tableviewcell height showing objects outside it's range

陌路散爱 提交于 2020-01-10 19:34:11

问题


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:

The following is the cell when collapsed:

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.

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


回答1:


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.



来源:https://stackoverflow.com/questions/21632970/ios-7-1-beta5-tableviewcell-height-showing-objects-outside-its-range

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!