使用 Three20 对超出表格范围的行/单元格重新排序时,表格视图不会滚动
当我在 Three20 TTTableViewController 中重新排序行/单元格(编辑表格并向上或向下移动单个单元格)时,它不会随着单元格移动到表格视图的边界之外而滚动。当我将单元格向上拖动超出边界时,它会自动将单元格动画向上并移出视图,而无需滚动它。这使得不可能有效地将单元重新排序到当前可见之外的位置。
我已经在使用和不使用 Three20 的情况下对此进行了测试,并且仅在使用 Three20 实现进行订购时不会滚动表格。
When I re-order rows/cells in my Three20 TTTableViewController (editing a table and moving individual cells up or down) it does not scroll with the cell being moved beyond the bounds of the tableview. When I do drag the cell up beyond the bounds it automatically animates the cell upwards and out of the view without scrolling with it. This makes it impossible to effectively re-order cells to positions outside of what is currently visible.
I have tested this with and without Three20 and it only doesn't scroll the table when ordering with the Three20 implementation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
显然,Three20 的
TTTableView
实现覆盖了UIScrollView
的- (void)setContentSize:(CGSize)size;
和
- (void)setContentOffset: (CGPoint)point;
这些旨在防止 contentOffset 随着表格内容大小或高度的变化而错误地更改,尽管在编辑模式下移动行时它会无意中阻止表格滚动。
我注释掉了这些方法,我需要的功能就可用了。
Apparently Three20's
TTTableView
implementation overridesUIScrollView
's- (void)setContentSize:(CGSize)size;
and
- (void)setContentOffset:(CGPoint)point;
These are meant to prevent the contentOffset from being changed incorrectly with a change in content size or height of the table, although it inadvertently prevents the table from scrolling when moving rows in editing mode.
I commented out these methods and the functionality I needed became available.
Three20 喜欢使用 setContentOffset 和 setContentSize 方法覆盖来控制滚动行为。滚动行为由scrollEnabled 属性控制。
TTTableViews的scrollEnabled = YES,但当时这个方法被称为scrollEnabled = NO,并且在重新排序行时需要重置。
tableView.scrollEnabled = YES;
}
Three20 likes to control scrolling behavior with the setContentOffset and setContentSize method overrides. Scrolling behavior is controlled with a scrollEnabled property.
TTTableViews are scrollEnabled = YES, but at the time this method is called scrollEnabled = NO and needs to be reset when reordering rows.
tableView.scrollEnabled = YES;
}