首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏全栈程序员必看

    ios-tableView的touchesBegan事件和didSelectRowAtIndexPath方法

    今天做了个测试,看看tableView如果实现了touchesBegan方法和实现了didSelectRowAtIndexPath点击的时候会去实现哪一个? 答案是touchesBegan。 touches withEvent:(UIEvent *)event { NSLog(@"------"); } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath

    49610编辑于 2022-09-16
  • 来自专栏小蠢驴iOS专题

    实际操作-手把手探究tableViewCell上的控件点击事件进阶篇:实际项目操作

    iOS17年4月市场背景~ 探究tableViewCell的点击事件步骤: 1.tableViewCell上的控件触发点击事件 ---- 我们都知道,tableViewCell的点击事件,写个“didSelectRowAtIndexPath 答:因为我们一开始并不知道要点击的是哪行的数据->在tableView的行点击(didSelectRowAtIndexPath)的时候,由于我们可以拿到点击的下标,通过下标可以知道我们点击的是哪行,此时发送数据请求 -->错误:1.我们点击的是头像(UIImageView),触发的是头像的点按手势,并不会调用didSelectRowAtIndexPath方法;               2.异步请求,在点击的时候 ,发送请求,点击整个操作结束后,异步的请求都不一定执行完,由于异步执行,数据经常是当时获取没完成就接下去执行了,导致数据为空;               3.在2的基础上,执行完didSelectRowAtIndexPath 之后AFN请求完毕,获取数据成功,以往我们经常调用tableView的刷新数据方法-reloadData,但是我们会发现didSelectRowAtIndexPath并不会再tableView reloadData

    4.1K50发布于 2018-05-24
  • 来自专栏君赏技术博客

    托管UITableView多样式cell的第三方库ZHTableViewGroup

    cellForRowAtIndexPath:(NSIndexPath *)indexPath 返回不同的cell,甚至需要在在 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath ; return cell; } #pragma mark - UITableViewDelegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath indexPath { ZHTableViewGroup *group = [self.dataSource groupWithIndex:indexPath.section]; [group didSelectRowAtIndexPath

    98610发布于 2018-09-07
  • 来自专栏hrscy

    在iOS中怎样创建可展开的Table View?(下)

    indexPath.row)而是可见cell的行索引,所以我们将会开始在下面的tableView代理方法里给它分配一个局部变量: func tableView(tableView: UITableView, didSelectRowAtIndexPath cell是可展开的,但是现在还没有展开,那么我们要标示(我们将使用一个flag标记)那个cell展开,否则我们要标示它合拢: func tableView(tableView: UITableView, didSelectRowAtIndexPath "isExpanded"属性,所以在随后的点击它将会有正确的行为(如果它是打开的那么就合拢,如果它是合拢的那么就打开). func tableView(tableView: UITableView, didSelectRowAtIndexPath ,优惠变为隐藏.实际上,通过改变那个属性的值,我们实际上实现了打开的效果(或是合拢的效果).所以,让我们修改上面的代码: func tableView(tableView: UITableView, didSelectRowAtIndexPath 看下面的代码: func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

    2.4K30发布于 2018-08-30
  • 来自专栏编程之旅

    iOS开发——UITableView勾选效果

    有以下几个注意点: - 首先在```- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *) strong) NSIndexPath *selectPath; //存放被点击的哪一行的标志 之后我们实现```- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath :(NSIndexPath *)indexPath```这个代理方法 (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:

    2.2K30发布于 2018-08-30
  • 来自专栏陈满iOS

    iOS小经验:UITableView&UICollectionView设置单元格的默认选中状态

    UITableView 3.1 通过屏幕点击改变的选中状态回调给代理 //选中 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath UITableViewScrollPositionTop]; if ([mytableview.delegate respondsToSelector:@selector(tableView:didSelectRowAtIndexPath :)]) { [mytableview.delegate tableView:mytableview didSelectRowAtIndexPath:indexPath]; }

    4.5K50发布于 2018-10-09
  • 来自专栏三掌柜的技术空间

    iOS开发:实现点击常用控件弹出地区选择框(万能方法)

    handler:nil]]; [self presentViewController:alert animated:YES completion:nil]; } 4、在UITableView的didSelectRowAtIndexPath 代理方法里面的操作如下 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

    2.2K32编辑于 2021-12-15
  • 来自专栏码农的生活

    UITableViewcell选中后怎么去掉背景灰色

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

    1.1K20发布于 2021-10-29
  • 来自专栏Helloted

    常用代码/Code

    *cell = [[UITableViewCell alloc]init]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath

    63420编辑于 2022-06-07
  • 来自专栏月亮与二进制

    iOS点击TableView的cell显示弹出动画

    ; } return _bgView; } 接下来就是动画的部分了,我们去到点击cell的方法,也就是 (void)tableView:(UITableView )tableView didSelectRowAtIndexPath indexPath 方法,代码如下: #pragma mark TableView Delegate // 选中某一行 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath

    2.1K10编辑于 2022-05-13
  • 来自专栏娱乐心理测试

    ios 开发常用技巧

    cell.selectionStyle = UITableViewCellSelectionStyleNone; 10.cell点按效果 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath

    75130发布于 2018-06-13
  • 来自专栏TechBox

    UITableViewCell系列之(一)让你的cell支持二次编辑

    思路如下: 注意:以下操作全部是在didSelectRowAtIndexPath:方法中进行的 获取点击的那一行cell在tableView坐标系上的frame,并转换为view坐标系上的frame, indexPath.row]]; cell.selected = NO; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath

    8.2K40发布于 2018-06-05
  • 来自专栏万岳科技那些事儿

    直播卖货小程序源码中,商品分类页面是如何实现的

    1、左侧一级分类的点击实现 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

    1.6K20发布于 2020-07-22
  • 来自专栏日常技术分享

    iOS TableViewCell中的KVO的使用

    forKeyPath:@"isRead"]; } } 使用KVO来监听isRead属性,当点击Cell的时候处理 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath

    1.3K20发布于 2020-02-13
  • 来自专栏iOS122-移动混合开发研究院

    JSPatch库, 一个Apple官方支持的实现在线更新iOS应用的库

    . - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSString ") } @end // JS defineClass("JPTableViewController", { // instance method definitions tableView_didSelectRowAtIndexPath

    1.4K70发布于 2018-01-02
  • 来自专栏全栈程序员必看

    Swift 书面 ToDo App

    } func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath } func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

    2.3K20编辑于 2022-07-06
  • 来自专栏hrscy

    iOS常见问题总结(二)

    view_bg.backgroundColor = [UIColor clearColor]; cell.selectedBackgroundView = view_bg; 3)点击cell行时,背景颜色一闪而过,在didSelectRowAtIndexPath

    1K20发布于 2018-08-30
  • 来自专栏全栈程序员必看

    手机通讯录实现

    self.titles; } #pragma mark - UITableViewDelegate //当cell被选中时触发 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath

    1.6K30编辑于 2022-07-06
  • 来自专栏三掌柜的技术空间

    iOS开发:Block传值的运用

    控制器B.m文件 控制器B.m文件里面,主要是在单元格的点击事件里面给Block里面的参数赋值,具体步骤如下所示: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath

    1.1K41编辑于 2021-12-02
  • 来自专栏学海无涯

    iOS开发之UITableView联动实现城市选择器

    return cell; } } #pragma mark UITableViewDelegate - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath

    2.7K60发布于 2018-05-03
领券