uitableview学习
来源:互联网 发布:申通快递单打印软件 编辑:程序博客网 时间:2024/04/24 12:59
设置圆角
- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view from its nib. self.mytv.layer.cornerRadius = 8.0;}
响应单元格右侧按钮
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{ }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString* cellID = @"cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; if(nil == cell) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; } cell.selected = NO; cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; cell.textLabel.text = @"f"; cell.detailTextLabel.text = @"ff"; cell.imageView.image = [UIImage imageNamed:@"avatar.png"]; return cell;}
添加脚注
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section;
弹出增加,删除按钮
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"edit" style:UIBarButtonItemStylePlain target:self action:@selector(edit)];}- (void)edit{ _edit = !_edit; [super setEditing:_edit animated:YES]; [_mytv setEditing:_edit animated:YES];}
点击可以蹦出删除,添加按钮
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{ if(indexPath.row %2 == 1) { return UITableViewCellEditingStyleInsert; } else { return UITableViewCellEditingStyleDelete; }}
0 0
- uitableview学习
- UITableView学习笔记
- UITableView学习笔记
- UITableView学习笔记
- UITableView学习笔记
- UITableView学习笔记
- UITableView学习笔记
- UITableView学习笔记
- UITableView学习笔记
- UITableView学习笔记
- UITableView学习笔记
- UITableView学习笔记
- UITableView学习笔记
- UITableView学习笔记
- IOS UITableView 学习笔记
- UITableView学习笔记
- IOS UITableView学习Demo
- UITableView学习笔记
- php蜘蛛正常抓取,用户跳转指定页面
- 复杂的分页查询
- Codeforces Round #236 (Div. 2) E. Strictly Positive Matrix 强连通
- Build相关属性和调用系统信息的方法
- 状态模式与状态图
- uitableview学习
- js 添加事件 attachEvent 和 addEventListener 的用法
- 修改boot.img
- 探究如何整合 GLib Main Event Loop 和 Node.js 的 libuv
- Windows Phone 8.1 系列文章索引
- android高分段进阶攻略(8)音乐播放器代码实现一SlidingDrawer实现
- javax.swing.filechooser 文件选择器
- 使用代理对安卓sdk的更新
- Eclipse中添加Tomcat服务器报错:Cannot create a server using the selected type 导致不能点击next