tableView的一些函数
来源:互联网 发布:ip网络广播系统设计厂 编辑:程序博客网 时间:2024/06/06 10:49
//返回行数
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{return [listData count];
}
//返回一个cell,即每一行所要显示的内容
{
static NSString * identify=@"identify";
UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:identify];
if(cell==nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identify];
}
NSUInteger row = [indexPath row];
cell.textLabel.text = [listData objectAtIndex:row];
UIImage *image=[UIImage imageNamed:@"qq.png"];
cell.imageView.image=image;
if(row<7)
cell.detailTextLabel.text = @"Mr . Disney";
else
cell.detailTextLabel.text = @"Mr . Tolkien";
return cell;
}
//设置一个叫indent level的属性,这样每一行都比上一行右移一点
{
NSUInteger row = [indexPath row];
return row;
}
//设置点击事件前可以设置哪一行不能响应点击事件
{
NSUInteger row=[indexPath row];
if(row==0)
{
return nil;
}
return indexPath;
}
//设置点击事件
{
NSUInteger row = [indexPath row];
NSString * rowvalue=[listData objectAtIndex:row];
NSString * message=[[NSString alloc] initWithFormat:@"你选择了%@",rowvalue];
UIAlertView *alert =[[UIAlertView alloc] initWithTitle:@"注意!" message:message delegate:nil cancelButtonTitle:@"取消" otherButtonTitles: nil];
[alert show];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
//设置列宽
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 70;
}
- tableView的一些函数
- tableView的一些方法
- tableview的一些使用方法
- tableView的一些细节
- tableview的一些基本知识
- tableView的一些使用
- tableView的一些坑
- Cocos2dx中TableView中一些函数的作用
- 关于tableview的一些bug
- tableView的一些基本方法
- iOS---tableView的一些内容
- tableview的一些常用方法
- 关于用xib创建静态tableview可能会用到的一些委托函数
- 关于用xib创建静态tableview可能会用到的一些委托函数
- TableView的一些需要掌握的东西
- 关于tableview 的一些属性设置
- CollectionView 与 TableView 的一些问题
- 一些tableView的基础Knowledge(2015414)
- Linux 编译安装 mongoDB
- Oracle中查找和删除重复记录方法简介
- 数据驱动组件
- HDUOJ Minimum Inversion Number
- 官方NotePad实例学习--ListActivity的使用
- tableView的一些函数
- 18.windbg-临界区leak案例
- 浅谈系统设计中的抽象和具体
- Php设计模式之工厂模式(一)简单工厂模式
- stackless python的疑问
- nginx:expires控制页面缓存以及加头
- 仅通过崩溃地址找出源代码的出错行
- Php设计模式之工厂模式(二)【工厂方法模式 Factory Method】
- 教你如何迅速秒杀掉:99%的海量数据处理面试题