UITableView的使用
来源:互联网 发布:linux gzip解压命令 编辑:程序博客网 时间:2024/06/04 00:43
使用UITableView的时候必须挂上两个代理协议UITableViewDataSource,UITableViewDelegate
UITableView *table = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT- 70) style:UITableViewStylePlain];
table.showsVerticalScrollIndicator = NO;
table.separatorStyle = UITableViewCellSeparatorStyleNone;
table.delegate = self;
table.dataSource = self;
table.backgroundView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"back"]];
table.backgroundColor = [UIColor blackColor];
[self.view addSubview:table];
常见代理的方法如下:
设置tableView的行数数
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
设置tableView显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
设置tableView组数
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;
设置tableView cell的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
设置tableView被选中的时候调用
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
- UITableView delegate的使用
- UITableView的简单使用
- UITableView的使用大全
- UITableView的使用
- UITableView的使用大全
- UITableView的使用大全
- UITableView的使用大全
- UITableView的使用
- ios UItableview的使用
- UITableView的简单使用
- UITableView的使用大全
- UITableView的使用大全
- UITableView的简单使用
- UITableView的使用详解
- UITableView的使用大全
- UITableView的使用大全
- UITableView的详细使用
- UITableView的使用
- 第六周--建设链栈的算法库
- HDU 5496 Beauty of Sequence
- 第三周 项目1 顺序表的基本运算
- 循环链表应用
- 第四周单链表的应用(1)——逆置
- UITableView的使用
- 【项目4 - 建设双链表算法库】
- mfc自定义工具栏如何锁定
- hadoop专有的数据类型
- HDU 5495 LCS
- CentOS 7 如何设置默认启动方式为命令行模式
- NOIP四校联训Round3小结
- Git使用
- 第4周项目3- 单链表算法(3)