您的位置:首页 > 其它

TableView相关小细节

2012-12-14 17:27 218 查看
1. UITableView隐藏没有数据的cell的边框线

- (void)setExtraCellLineHidden: (UITableView *)tableView
{
UIView *view =[ [UIView alloc]init];
view.backgroundColor = [UIColor clearColor];
[tableView setTableFooterView:view];
[view release];
}

2. 设置TableView的边框线,(需引进QuartzCore.framework)

Table.layer.borderWidth = 1;
Table.layer.borderColor = [UIColor redColor];

3.  设置TableView初始化时默认滚动到某一行
NSIndexPath *idxPath = [NSIndexPath indexPathForRow:i inSection:0]; //i为需要滚动到的行数
[Table scrollToRowAtIndexPath:idxPath atScrollPosition:UITableViewScrollPositionTop animated:NO];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: