您好,欢迎来到二三娱乐。
搜索
您的当前位置:首页取消tableViewCell 的选中状态

取消tableViewCell 的选中状态

来源:二三娱乐

- (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath {

//其他代码

[tableView deselectRowAtIndexPath:indexPath animated:YES];// 取消选中

//其他代码

}

- (void)deselectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated

方法的官方文档描述:Deselects a given row identified by index path, with an option to animate the deselection.

Calling this method does not cause the delegate to receive a tableView:willDeselectRowAtIndexPath: or tableView:didDeselectRowAtIndexPath: message, nor does it send UITableViewSelectionDidChangeNotification notifications to observers.

Calling this method does not cause any scrolling to the deselected row.

中文的意思就是:根据 indexPath 以动画的形式取消选中。调用此方法不会造成委托接受tableView:willDeselectRowAtIndexPath和tableView:didDeselectRowAtIndexPath:消息;不给UITableViewSelectionDidChangeNotification通知观察者;调用此方法不会产生任何滚动到取消行。

Copyright © 2019- yule263.com 版权所有 湘ICP备2023023988号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务