uitableview

来源:互联网 发布:数据库市场规模 编辑:程序博客网 时间:2024/05/05 04:34
tableview.dataSource = self;
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的选中

[tableviewdeselectRowAtIndexPath:[tableviewindexPathForSelectedRow] animated:YES];





ios7特性:

ios7分割线没有居左,向右移了10个像素,想让他居左 tableview.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);

这个只有IOS7才有的属性,使用时需要作版本判断。

0 0
原创粉丝点击