tableView一些细节问题用于开发

来源:互联网 发布:录手机屏幕的软件 编辑:程序博客网 时间:2024/06/14 09:25

1.UITabelviewCell 的高亮状态的取消用以下方法: 

-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{    //设置cell的背景是透明的。    cell.backgroundColor = [UIColor clearColor];    //取消cell的高亮状态    cell.selectionStyle = UITableViewCellSelectionStyleNone;}//使用下面的这个方法会导致cell不能响应点击事件- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath {    return YES;}

2.设置分割线的左右偏移量

tableview  setSeparatorInset:inset  
0 0
原创粉丝点击