tableview.dataSource = self;
tableview.delegate = self;
//分割线
tableview.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
//分割线颜色
tableview.separatorColor = .......;
//uitableview的style为UITableViewStyleGrouped时,设置背景色用
tableview.backgroundView = Nil;
//背景色
tableview.delegate = self;
//分割线
tableview.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
//分割线颜色
tableview.separatorColor = .......;
//uitableview的style为UITableViewStyleGrouped时,设置背景色用
tableview.backgroundView = Nil;
//背景色
tableview.backgroundColor =.......;
设置滚动条位置Y轴
tableview.contentOffset = CGPointMake(0,yValue);
滚动条动画设置位置
NSTimeInterval animationDuration=0.70f;
[UIViewbeginAnimations:@"ScorollY"context:nil];
[UIViewsetAnimationDuration:animationDuration];
tableview.contentOffset =CGPointMake(0,80.f);
[UIViewcommitAnimations];
取消cell的选中
[tableview deselectRowAtIndexPath:[tableview indexPathForSelectedRow] animated:YES];
ios7特性:
ios7分割线没有居左,向右移了10个像素,想让他居左 tableview.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
这个只有IOS7才有的属性,使用时需要作版本判断。