UITableView 的一些小知识
来源:互联网 发布:c语言毕业设计题目 编辑:程序博客网 时间:2024/05/20 21:48
typedef enum {
UITableViewCellSelectionStyleNone,
UITableViewCellSelectionStyleBlue,
UITableViewCellSelectionStyleGray
} UITableViewCellSelectionStyle
//cell右边按钮格式
typedef enum {
UITableViewCellAccessoryNone, // don't show any accessory view
UITableViewCellAccessoryDisclosureIndicator, // regular chevron. doesn't track
UITableViewCellAccessoryDetailDisclosureButton, // blue button w/ chevron. tracks
UITableViewCellAccessoryCheckmark // checkmark. doesn't track
} UITableViewCellAccessoryType
//是否加换行线
typedef enum {
UITableViewCellSeparatorStyleNone,
UITableViewCellSeparatorStyleSingleLine
} UITableViewCellSeparatorStyle//改变换行线颜色
1.点击某一个cell后,将会进入另一个View,返回又回到原始View的最顶端,怎么样才能还返回在点击之前的那个位置呢?
NSIndexPath *ip = [ NSIndexPath indexPathForRow:row inSection:section ];
[TopicsTable selectRowAtIndexPath: ip animated: YES scrollPosition : UITableViewScrollPositionNone ];
2.选中Cell响应事件
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:YES]; //选中后的返现颜色即刻消失
}
3.在程序中,有时候会不想让用户去点击某一行,可以这样做:
- (NSIndexPath *)tableView :(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSUInteger row = [indexPath row];
if( row == 0) return nil; //阻止选中第一行
return indexPath;
}
4.滑动cell是否出现del按钮
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{
}
5.编辑状态
- (void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{
[topicsTable setContentSize:CGSizeMake(0,controller.promiseNum * 44)];
}
6.右侧添加一个索引表
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableVIew{
}
7.返回标题section标题内容
- (NSString *)tableView:(UITableView *)tableView titleForHeardInSection:(NSInteger)section{
}
- UITableView 的一些小知识
- UITableView 的一些小知识
- UITableView的小知识
- UItableView 的一些小细节
- UiTableview的常用小知识汇集
- UITableViewRowAction -- UITableView的一些小技巧
- UItableView一些小方法
- ASP的一些小知识
- 一些小的网络知识
- vc的一些小知识
- javascript的一些小知识
- Ruby的一些小知识
- 数据库的一些小知识
- 一些wince的小知识
- nfs的一些小知识
- 一些凌乱的小知识
- Linux的一些小知识
- 麦克风的一些小知识
- 将 Shiro 作为应用的权限基础
- java IO
- 31天重构学习笔记重新整理下载
- UITableView 性能优化
- zoj 2723(数论,水素数)
- UITableView 的一些小知识
- windows 消息代码大全
- spring3.2.2的aop实例讲解
- oRTP移植到DM6446
- 1 IntelliSense: #error 指令: Please use the /MD switch for _AFXDLL builds
- MySql 常用命令总结
- 《老王,老刘和老张》《小红和小芳》
- 2013.4 CPU天梯
- 查看8080端口被什么程序占用