遇见就记 每天进步一些
cell分割线 顶头 去尾
TableView.layoutMargins = UIEdgeInsetsZero
TableView.separatorInset = UIEdgeInsetsZero;
TableView.tableFooterView = [[UIView alloc]initWithFrame:CGRectZero
点击不变色
cell.selectionStyle = UITableViewCellSelectionStyleNone;
隐藏分割线
TableView.separatorStyle = UITableViewCellEditingStyleNone;
设置颜色
[tableView setSeparatorColor:];
后去cell 里的某一个值
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:3];
TableViewCell*cell = [TableView cellForRowAtIndexPath:indexPath];
[cell viewWithTag:];//cell里 for循环的值
点击跳转到cell的指定位置
NSInteger position = 组头数;
NSIndexSet *indesSet = [NSIndexSet indexSetWithIndex:position];
[tableView reloadSections:indesSet withRowAnimation:UITableViewRowAnimationFade];//在tableview 点击方法里
[_anonymousTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:5] animated:YES scrollPosition:UITableViewScrollPositionTop];
删除某一组
// NSIndexSet *indexSet = [[NSIndexSet alloc]initWithIndex:btn.tag-1000];
LZDynViewModel * model = [LZDynViewModel mj_objectWithKeyValues:modelArr[btn.tag-1000]];
deleStr = model.aid;
[modelArr removeObjectAtIndex:btn.tag - 1000];
[_MyTableView beginUpdates];
//[_MyTableView deleteSections:indexSet withRowAnimation:UITableViewRowAnimationFade];
[_MyTableView endUpdates];
删除某一行
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:btn.tag-1000 inSection:0];
[_MyTableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
[_MyTableView endUpdates];
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 单元测试从入门到精通