关于TableView
1.调用的时候注意设置2个委托,<UITableViewDelegate,UITableViewDataSource>
2.2个必须实现的方法,行数和行的路径:numberOfRowsInSection,cellForRowAtIndexPath,
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
3.选择行的方法,didSelectRowAtIndexPath
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
4.删除行的方法 :
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
本文详细介绍了UITableView的基本使用方法,包括设置代理、实现必选方法(如确定行数和配置单元格)、处理行的选择及删除操作等核心功能。
169

被折叠的 条评论
为什么被折叠?



