打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
ios开发之tableView/collectionView获取当前点击cell
一般collectionView 或者 tableview都有自带的点击函数,如下:1, collectionView   -(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{//一般情况,cell不是自定义    UICollectionViewCell * cell = (UICollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath]; //即为要得到的cell//自定义的cell   TitleViewCell * cell = (TitleViewCell *)[self collectionView:collectionView cellForItemAtIndexPath:indexPath];//即为要得到的cell}2,tableView-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{//非自定义cell    UITableViewCell * cell = (UITableViewCell *)[tableView cellForRowAtIndexPath:indexPath]; //自定义cell     NewsTableViewCell * cell = (NewsTableViewCell *)[self tableView:tableView cellForRowAtIndexPath:indexPath];}
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
iOS 中 TableView 内嵌套 CollectionView 动态高度的实现
iOS系列译文:整洁的表视图代码
ios之TableViewCell重用机制避免重复显示问题,iostableviewcell
iOS开发 精简TableView
WaxPatch Dynamically load a lua script to change the behavior of your iOS application.
IOS研究成果
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服