Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QMUICommonTableViewController 在 viewWillAppear 的时候自动清除列表选中态 #558

Closed
wxlpp opened this issue Apr 10, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@wxlpp
Copy link

commented Apr 10, 2019

请填写运行环境

设备版本无关

请描述具体问题

QMUICommonTableViewController 在 viewWillAppear 的时候自动清除列表选中态,且不可控。导致编辑行多选列表在侧滑后丢失选中态。并且有默认选中态的列表也要在viewWillAppear中特殊处理。
- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.tableView qmui_clearsSelection]; }

相关截图(断点的堆栈、控制台的 log)

@MoLice

This comment has been minimized.

Copy link
Collaborator

commented Apr 15, 2019

经测试,系统的 UITableViewController 当 self.tableView.allowsMultipleSelection = YES; 时,在 viewWillAppear: 里不会清除选中状态,而当 allowsMultipleSelection = NO 时,会与 QMUI 一样清除选中状态,所以这里下个版本会加上 allowsMultipleSelection 值的判断,在此之前你可以参照以下代码先临时修改:

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    if (!self.tableView.allowsMultipleSelection) {
        [self.tableView qmui_clearsSelection];
    }
}

@MoLice MoLice added the bug label Apr 15, 2019

@MoLice

This comment has been minimized.

Copy link
Collaborator

commented Apr 19, 2019

已发布 3.1.5 修复该问题。

@MoLice MoLice closed this Apr 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.