tableview取消选中某一行

//取消选中
- (void)deselect{

    [_tableView deselectRowAtIndexPath:[_tableView indexPathForSelectedRow] animated:YES];

}

//在点击某一行中添加
[self performSelector:@selector(deselect) withObject:nil afterDelay:0.5f];
时间: 2024-08-30 15:06:24

tableview取消选中某一行的相关文章

tableview默认选中第一行

 // 默认选中第一行只执行一次(否则有BUG)     if (!isRuned) {         NSIndexPath *firstPath = [NSIndexPathindexPathForRow:0inSection:0];         [m_tableViewselectRowAtIndexPath:firstPath animated:YESscrollPosition:UITableViewScrollPositionTop];                  isR

UITableView取消选中颜色、常用操作

使用空白view取代cell - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //取消选中颜色 UIView *backView = [[UIView alloc] initWithFrame:cell.frame]; cell.selectedBackgroundView = backView; cell.selectedBackgro

iOS uitableViewCell 选中 push后返回 取消选中状态

首先我有一个UITableViewController,其中每个UITableViewCell点击后都会push另一个 ViewController,每次点击Cell的时候,Cell都会被选中,当从push的ViewController返回的时候选中的Cell便会 自动取消选中.后来由于某些原因我把这个UITableViewController改成了UIViewController,之后就产生了一个问题:每 次返回到TableView的时候,之前选中的Cell不能自动取消选中,经过查找得知: U

cell的选中和取消选中

//数据源协议中有两个方法,在cell被选中或取消时被触发 //didSelect,当你选中某个cell时,就会调用该方法. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ } //didDeselect,当取消选中cell时,就会调用改方法. -(void)tableView:(UITableView *)tableView didDeselectRowAtI

UITableView的颜色设置和cell的自动取消选中状态

1.系统默认的颜色设置 //无色 cell.selectionStyle = UITableViewCellSelectionStyleNone; //蓝色 cell.selectionStyle = UITableViewCellSelectionStyleBlue; //灰色 cell.selectionStyle = UITableViewCellSelectionStyleGray; 2.自定义颜色和背景设置  改变UITableViewCell选中时背景色: UIColor *colo

UITableView默认选中第一行

//如果有数据,选中第一行 if(tableDataSource.count > 0) { NSIndexPath *indextPath = [NSIndexPath indexPathForRow:0 inSection:0]; // 调用UItableViewDelegate [self tableView:self.selectDeptTable didSelectRowAtIndexPath:indextPath]; // 选中第一行 [self.tableView selectRow

EasyUI DataGrid单选如何取消选中

EasyUI DataGrid在多选时,选中某行,可以取消:而在单选时,并不能取消选中某一行. 可以通过修改源码来完成. 在其源码中找到 opts.singleSelect==true 将代码做如下修改(参考版本是jQuery EasyUI 1.4.1) 修改前: _5df(_5da,_5db); 修改后 if(tr.hasClass("datagrid-row-selected")){ _5e0(_5da,_5db); }else{ _5df(_5da,_5db); } 注意:不同版

tableviewcell的取消选中,高亮

1.取消多余cell的分割线 UIView *view = [UIView new]; view.backgroundColor = [UIColor clearColor]; [tableView setTableFooterView:view]; 2.取消cell选中状态 代理 didselected - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //

EasyUI带选择框的DataGrid实现点击行"不选中或取消选中"的解决方法。

1 var IsCheckFlag = true; //标示是否是勾选复选框选中行的,true - 是 , false - 否 2 $("#dg").datagrid({ 3 rownumbers:true, 4 url: 'LeadsData.ashx?o=list', 5 method:'get', 6 fit: true, 7 striped:true, 8 pagination: true, 9 fitColumns: true, 10 checkOnSelect: false