IOS TableView 去除点击后产生的灰色背景
2024-08-24 23:17:01
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"activityTableViewCell";
activityTableViewCell *cell = (activityTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[activityTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
} cell.selectionStyle=UITableViewCellSelectionStyleNone;//设置cell点击效果 return cell;
}
或者
//重写 cell 点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
//当离开某行时,让某行的选中状态消失
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
最新文章
- 初探物联网 - 基于Arduino的气象站和View and Data API的结合实例
- 测试函数用Return 返回值和用函数名返回值的区别
- Linux time命令
- SQL数据库基础(七)
- [leetcode] Contains Duplicate
- 0c-39-ARC下单对象内存管理
- Web前端新人笔记之HeightCharts基础
- 自定义PopupWindow动画效果
- C#开发客户端、JAVA和tomcat开发服务端
- 论山寨手机与Android联姻 【10】SmartPhone的通信机制
- tomcat dbcp 基于jndi当配置java.sql.SQLException: Already closed
- 移动开发中Fiddler的那些事儿 (转)
- jQuery图片切换插件jquery.cycle.js
- 前端之 CSS🤖
- Django troubleshootings
- Ocelot简易教程(六)之重写配置文件存储方式并优化响应数据
- CentOS安装jdk的三种方法
- java 定时任务之一 @Scheduled注解(第一种方法)
- koa文档参考
- PostgreSQL之连接数修改