Rearranging UITableViewCells causes cell contents to break

吃可爱长大的小学妹 提交于 2019-12-23 23:52:56

问题


I have an iOS4 iPad app that I'm upgrading to iOS5, and there is one issue that I don't fully understand what is going on.

The view in question uses a UITableView with a number of subclassed UITableViewCells to display a series of different (and modifiable) fields. Each cell contains UI buttons, UITextFields, etc etc, and is used to readily store a variable amount of controls.

Via tableView:canMoveRowAtIndexPath: we've enabled the ability for the user to rearrange the order of the rows using drag-and-drop. It worked perfectly in iOS4, but as of iOS5 has ceased to function properly. A simple swap leaves the moved cell's text fields looking disabled (without their white background), and subsidiary cells further down can become 'bugged', vanishing from the screen in an unpredictable manner -- leaving white spaces where they should be.

What changed between iOS4 and iOS5 that causes this issue, and how can I correct it?


回答1:


as of iOS 5, you must also implement tableView:moveRowAtIndexPath:toIndexPath: to enable reordering; are you doing this?



来源:https://stackoverflow.com/questions/9571630/rearranging-uitableviewcells-causes-cell-contents-to-break

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