【问题标题】:Issue with expanding/collapsing UITableView rows in section在部分中展开/折叠 UITableView 行的问题
【发布时间】:2018-06-12 23:58:23
【问题描述】:

我在展开和折叠 UiTableView 行时遇到问题,不知道如何排除故障或可能是什么原因。当该部分展开时,它会导致抖动,其他行似乎会上下移动。

问题来了: https://www.useloom.com/share/14c1cdd27e7844dcad31dad30d4aa1ce

当该行被切换时,将执行以下代码:

    section.showPrompts = !section.showPrompts;    
    [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation:UITableViewRowAnimationFade];

【问题讨论】:

    标签: ios uitableview


    【解决方案1】:

    你可以尝试批量更新

    [self.tableview beginUpdates];
    ... your code ...
    [self.tableview endUpdates];
    

    这样所有的动画都是同步的。

    【讨论】:

    • 这似乎没有任何作用。还是同样的问题。
    • 您能否提供更多关于如何调用上述 sn-p 的详细信息?你在 UITableViewDelegate 回调中吗?看起来您正在与飞行中的其他动画竞争,但如果不了解更多有关调用堆栈的信息,则很难诊断。
    猜你喜欢
    • 2015-06-27
    • 2010-12-28
    • 2013-06-19
    • 2019-08-31
    • 1970-01-01
    • 1970-01-01
    • 2014-12-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多