iOS - 03
来源:互联网 发布:微信域名举报监控 编辑:程序博客网 时间:2024/06/13 18:27
1.昨天碰到的一个问题,列表分组拉不上去的原因:
TableView没有放好,放在了view视图偏下,导致运行时列表始终拉不上去,在使用列表的时候注意摆好位置。
2.tableview 加载更多的实现
很简单,自定义一个cell用来显示加载更多字样,然后通过
UINib *nib = [UINib nibWithNibName:@"NextPageCell" bundle:nil];
[tableView registerNib:nib forCellReuseIdentifier:identifier];
注册自定义的cell
NextPageCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; 获得自定义cell的实例
numberOfRowsInSection这个方法中返回,data.count +1
然后在点击的时候判断是否点击的是最后一个,即判断indexPath.row+1 == data.count+1 如果是则是点击加载更多,加载数据,
用[tableView reloadData]方法重新装载新添加的数据
UITableView
didSelectRowAtIndexPath
didDeselectRowAtIndexPath 这两个方法一旦粗心就很容易搞混,多注意点
//用来实现根据字母查询分组
-(NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
return keys;
}
在显示不同的UITableViewCell的时候 static NSString *cellIdentifier = @"CellIndentifier_";//这个标识会影响cell
- iOS - 03
- iOS笔记03
- ios基础知识--03
- iOS学习- 03 控件
- iOS--线程安全03
- iOS
- iOS
- IOS
- iOS
- iOS
- IOS
- ios
- iOS
- iOS
- IOS
- iOS
- ios
- ios ~~~~~
- 代码的坏味道之二十二 :Comments(过多的注释)
- C#调用WebService实现天气预报
- AndroidJSON解析
- 广州驾照四必考注意事项
- static
- iOS - 03
- ANDROID模块编译
- tar 命令
- Advertising without Compromising User Experience 不降低用户体验的广告
- java使用PinYin4j将汉字转换为拼音
- 文章总结:ASPLOS 2013 Architecture I
- 设置听筒模式
- .NET开源表达式计算组件介绍与使用
- 集合—Map—Test